home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / ARMTEX / SOURCES2 / !TeX / texmf / source / armTeX / web2c / c / y_tab < prev   
Encoding:
Text File  |  1998-03-15  |  77.8 KB  |  2,573 lines

  1.  
  2. /*  A Bison parser, made from y.web2c with Bison version GNU Bison version 1.24
  3.   */
  4.  
  5. #define YYBISON 1  /* Identify Bison output.  */
  6.  
  7. #define    array_tok    258
  8. #define    begin_tok    259
  9. #define    case_tok    260
  10. #define    const_tok    261
  11. #define    do_tok    262
  12. #define    downto_tok    263
  13. #define    else_tok    264
  14. #define    end_tok    265
  15. #define    file_tok    266
  16. #define    for_tok    267
  17. #define    function_tok    268
  18. #define    goto_tok    269
  19. #define    if_tok    270
  20. #define    label_tok    271
  21. #define    of_tok    272
  22. #define    procedure_tok    273
  23. #define    program_tok    274
  24. #define    record_tok    275
  25. #define    repeat_tok    276
  26. #define    then_tok    277
  27. #define    to_tok    278
  28. #define    type_tok    279
  29. #define    until_tok    280
  30. #define    var_tok    281
  31. #define    while_tok    282
  32. #define    others_tok    283
  33. #define    r_num_tok    284
  34. #define    i_num_tok    285
  35. #define    string_literal_tok    286
  36. #define    single_char_tok    287
  37. #define    assign_tok    288
  38. #define    two_dots_tok    289
  39. #define    undef_id_tok    290
  40. #define    var_id_tok    291
  41. #define    proc_id_tok    292
  42. #define    proc_param_tok    293
  43. #define    fun_id_tok    294
  44. #define    fun_param_tok    295
  45. #define    const_id_tok    296
  46. #define    type_id_tok    297
  47. #define    hhb0_tok    298
  48. #define    hhb1_tok    299
  49. #define    field_id_tok    300
  50. #define    define_tok    301
  51. #define    field_tok    302
  52. #define    break_tok    303
  53. #define    not_eq_tok    304
  54. #define    less_eq_tok    305
  55. #define    great_eq_tok    306
  56. #define    or_tok    307
  57. #define    unary_plus_tok    308
  58. #define    unary_minus_tok    309
  59. #define    div_tok    310
  60. #define    mod_tok    311
  61. #define    and_tok    312
  62. #define    not_tok    313
  63.  
  64. #line 19 "y.web2c"
  65.  
  66. #include "web2c.h"
  67.  
  68. #define YYDEBUG 1
  69.  
  70. #define    symbol(x)    sym_table[x].id
  71. #define    MAX_ARGS    50
  72.  
  73. static char fn_return_type[50], for_stack[300], control_var[50],
  74.             relation[3];
  75. static char arg_type[MAX_ARGS][30];
  76. static int last_type = -1, ids_typed;
  77. char my_routine[100];    /* Name of routine being parsed, if any */
  78. static char array_bounds[80], array_offset[80];
  79. static int uses_mem, uses_eqtb, lower_sym, upper_sym;
  80. static FILE *orig_std;
  81. boolean doing_statements = false;
  82. static boolean var_formals = false;
  83. static int param_id_list[MAX_ARGS], ids_paramed=0;
  84.  
  85. extern char conditional[], temp[], *std_header;
  86. extern int tex, mf, strict_for;
  87. extern FILE *coerce;
  88. extern char coerce_name[];
  89. extern boolean debug;
  90.  
  91. static long my_labs();
  92. static void compute_array_bounds(), fixup_var_list();
  93. static void do_proc_args(), gen_function_head();
  94. static boolean doreturn();
  95.  
  96.  
  97. #ifndef YYLTYPE
  98. typedef
  99.   struct yyltype
  100.     {
  101.       int timestamp;
  102.       int first_line;
  103.       int first_column;
  104.       int last_line;
  105.       int last_column;
  106.       char *text;
  107.    }
  108.   yyltype;
  109.  
  110. #define YYLTYPE yyltype
  111. #endif
  112.  
  113. #ifndef YYSTYPE
  114. #define YYSTYPE int
  115. #endif
  116. #include <stdio.h>
  117.  
  118. #ifndef __cplusplus
  119. #ifndef __STDC__
  120. #define const
  121. #endif
  122. #endif
  123.  
  124.  
  125.  
  126. #define    YYFINAL        417
  127. #define    YYFLAG        -32768
  128. #define    YYNTBASE    75
  129.  
  130. #define YYTRANSLATE(x) ((unsigned)(x) <= 313 ? yytranslate[x] : 239)
  131.  
  132. static const char yytranslate[] = {     0,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  136.      2,     2,     2,     2,     2,     2,     2,     2,     2,    67,
  137.     68,    60,    55,    69,    56,    74,    61,     2,     2,     2,
  138.      2,     2,     2,     2,     2,     2,     2,    73,    66,    51,
  139.     49,    52,     2,     2,     2,     2,     2,     2,     2,     2,
  140.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  141.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  142.     71,     2,    72,    70,     2,     2,     2,     2,     2,     2,
  143.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  144.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  145.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  146.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  147.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  148.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  149.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  150.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  151.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  152.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  153.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  154.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  155.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  156.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  157.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  158.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  159.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  160.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  161.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  162.     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
  163.     46,    47,    48,    50,    53,    54,    57,    58,    59,    62,
  164.     63,    64,    65
  165. };
  166.  
  167. #if YYDEBUG != 0
  168. static const short yyprhs[] = {     0,
  169.      0,     1,     2,    13,    14,    17,    22,    27,    32,    39,
  170.     44,    51,    56,    63,    68,    72,    73,    74,    75,    84,
  171.     85,    86,    91,    93,    97,    99,   100,   103,   105,   108,
  172.    109,   110,   117,   119,   121,   123,   125,   127,   129,   131,
  173.    132,   135,   137,   140,   141,   142,   143,   151,   153,   155,
  174.    157,   159,   163,   164,   166,   169,   171,   173,   175,   177,
  175.    179,   181,   184,   191,   200,   202,   204,   206,   207,   212,
  176.    214,   218,   219,   220,   226,   227,   229,   233,   235,   237,
  177.    238,   243,   244,   247,   249,   252,   253,   254,   261,   263,
  178.    267,   269,   271,   273,   274,   275,   281,   282,   284,   287,
  179.    290,   293,   296,   297,   303,   304,   310,   311,   312,   317,
  180.    319,   323,   324,   329,   330,   333,   334,   338,   340,   342,
  181.    345,   346,   347,   348,   358,   359,   360,   361,   371,   373,
  182.    375,   377,   381,   382,   387,   389,   393,   395,   399,   401,
  183.    403,   405,   407,   409,   411,   413,   415,   416,   421,   422,
  184.    427,   428,   432,   434,   436,   438,   440,   443,   444,   449,
  185.    452,   455,   458,   460,   461,   466,   469,   470,   475,   476,
  186.    481,   482,   487,   488,   493,   494,   499,   500,   505,   506,
  187.    511,   512,   517,   518,   523,   524,   529,   530,   535,   536,
  188.    541,   542,   547,   548,   553,   555,   557,   559,   561,   562,
  189.    567,   569,   571,   573,   574,   578,   579,   584,   586,   587,
  190.    592,   595,   598,   599,   601,   603,   604,   608,   611,   612,
  191.    614,   616,   618,   620,   622,   624,   627,   628,   629,   636,
  192.    637,   641,   642,   643,   651,   653,   657,   661,   663,   667,
  193.    669,   671,   673,   676,   678,   680,   682,   683,   684,   691,
  194.    692,   693,   700,   701,   702,   703,   713,   715,   716,   717,
  195.    723,   724,   725
  196. };
  197.  
  198. static const short yyrhs[] = {    -1,
  199.      0,    78,    80,    76,    85,    89,    97,   124,    77,   133,
  200.    131,     0,     0,    78,    79,     0,    46,    47,    35,    66,
  201.      0,    46,    13,    35,    66,     0,    46,     6,    35,    66,
  202.      0,    46,    13,    35,    67,    68,    66,     0,    46,    18,
  203.     35,    66,     0,    46,    18,    35,    67,    68,    66,     0,
  204.     46,    24,    35,    66,     0,    46,    24,    35,    49,   105,
  205.     66,     0,    46,    26,    35,    66,     0,    19,    35,    66,
  206.      0,     0,     0,     0,    82,    85,    89,    97,    83,   124,
  207.     84,   158,     0,     0,     0,    16,    86,    87,    66,     0,
  208.     88,     0,    87,    69,    88,     0,    30,     0,     0,     6,
  209.     90,     0,    91,     0,    90,    91,     0,     0,     0,    92,
  210.     35,    93,    49,    94,    66,     0,    30,     0,    29,     0,
  211.     95,     0,    96,     0,    31,     0,    32,     0,    41,     0,
  212.      0,    24,    98,     0,    99,     0,    98,    99,     0,     0,
  213.      0,     0,   100,    35,   101,    49,   102,   103,    66,     0,
  214.    104,     0,   109,     0,   105,     0,   108,     0,   107,    34,
  215.    107,     0,     0,    58,     0,   106,    30,     0,    41,     0,
  216.     42,     0,   111,     0,   114,     0,   122,     0,   110,     0,
  217.     70,    42,     0,     3,    71,   112,    72,    17,   113,     0,
  218.      3,    71,   112,    69,   112,    72,    17,   113,     0,   105,
  219.      0,    42,     0,   103,     0,     0,    20,   115,   116,    10,
  220.      0,   117,     0,   116,    66,   117,     0,     0,     0,   118,
  221.    120,    73,   119,   103,     0,     0,   121,     0,   120,    69,
  222.    121,     0,    35,     0,    45,     0,     0,    11,    17,   123,
  223.    103,     0,     0,    26,   125,     0,   126,     0,   125,   126,
  224.      0,     0,     0,   127,   129,    73,   128,   103,    66,     0,
  225.    130,     0,   129,    69,   130,     0,    35,     0,    36,     0,
  226.     45,     0,     0,     0,     4,   132,   161,    10,    74,     0,
  227.      0,   134,     0,   133,   134,     0,   135,    66,     0,   148,
  228.     66,     0,   136,    81,     0,     0,    18,    35,   137,   139,
  229.     66,     0,     0,    18,   147,   138,   139,    66,     0,     0,
  230.      0,    67,   140,   141,    68,     0,   144,     0,   141,    66,
  231.    144,     0,     0,   143,   129,    73,    42,     0,     0,   145,
  232.    142,     0,     0,    26,   146,   142,     0,    37,     0,    38,
  233.      0,   149,    81,     0,     0,     0,     0,    13,    35,   150,
  234.    139,    73,   151,   157,   152,    66,     0,     0,     0,     0,
  235.     13,   156,   153,   139,    73,   154,   157,   155,    66,     0,
  236.     39,     0,    40,     0,   103,     0,     4,   161,    10,     0,
  237.      0,     4,   160,   161,    10,     0,   162,     0,   161,    66,
  238.    162,     0,   164,     0,   163,    73,   164,     0,    30,     0,
  239.    165,     0,   206,     0,   166,     0,   202,     0,   204,     0,
  240.    205,     0,    48,     0,     0,   169,    33,   167,   177,     0,
  241.      0,   171,    33,   168,   177,     0,     0,    36,   170,   172,
  242.      0,    36,     0,    39,     0,    40,     0,   173,     0,   172,
  243.    173,     0,     0,    71,   174,   177,   175,     0,    74,    45,
  244.      0,    74,    43,     0,    74,    44,     0,    72,     0,     0,
  245.     69,   176,   177,    72,     0,   192,   177,     0,     0,   177,
  246.     55,   178,   177,     0,     0,   177,    56,   179,   177,     0,
  247.      0,   177,    60,   180,   177,     0,     0,   177,    62,   181,
  248.    177,     0,     0,   177,    49,   182,   177,     0,     0,   177,
  249.     50,   183,   177,     0,     0,   177,    63,   184,   177,     0,
  250.      0,   177,    51,   185,   177,     0,     0,   177,    52,   186,
  251.    177,     0,     0,   177,    53,   187,   177,     0,     0,   177,
  252.     54,   188,   177,     0,     0,   177,    64,   189,   177,     0,
  253.      0,   177,    57,   190,   177,     0,     0,   177,    61,   191,
  254.    177,     0,   193,     0,    58,     0,    59,     0,    65,     0,
  255.      0,    67,   194,   177,    68,     0,   169,     0,    94,     0,
  256.     39,     0,     0,    40,   195,   196,     0,     0,    67,   197,
  257.    198,    68,     0,   200,     0,     0,   198,    69,   199,   200,
  258.      0,   177,   201,     0,    73,    30,     0,     0,    37,     0,
  259.     35,     0,     0,    38,   203,   196,     0,    14,    30,     0,
  260.      0,   159,     0,   207,     0,   222,     0,   208,     0,   214,
  261.      0,   209,     0,   209,   212,     0,     0,     0,    15,   210,
  262.    177,   211,    22,   162,     0,     0,     9,   213,   162,     0,
  263.      0,     0,     5,   215,   177,    17,   216,   217,   221,     0,
  264.    218,     0,   217,    66,   218,     0,   219,    73,   164,     0,
  265.    220,     0,   219,    69,   220,     0,    30,     0,    28,     0,
  266.     10,     0,    66,    10,     0,   223,     0,   226,     0,   229,
  267.      0,     0,     0,    27,   224,   177,   225,     7,   162,     0,
  268.      0,     0,    21,   227,   161,    25,   228,   177,     0,     0,
  269.      0,     0,    12,   230,   233,    33,   231,   234,     7,   232,
  270.    162,     0,    36,     0,     0,     0,   177,   235,    23,   236,
  271.    177,     0,     0,     0,   177,   237,     8,   238,   177,     0
  272. };
  273.  
  274. #endif
  275.  
  276. #if YYDEBUG != 0
  277. static const short yyrline[] = { 0,
  278.     55,    61,    65,    69,    71,    74,    80,    85,    90,    95,
  279.    100,   105,   110,   119,   126,   130,   135,   151,   156,   187,
  280.    188,   190,   194,   195,   198,   202,   203,   207,   208,   211,
  281.    214,   218,   223,   231,   235,   237,   241,   255,   273,   277,
  282.    278,   281,   282,   285,   288,   294,   298,   310,   311,   314,
  283.    355,   358,   361,   362,   365,   371,   379,   390,   395,   396,
  284.    400,   406,   417,   418,   422,   424,   433,   437,   439,   443,
  285.    444,   447,   449,   455,   468,   471,   472,   475,   487,   499,
  286.    502,   505,   506,   509,   510,   513,   520,   525,   529,   530,
  287.    533,   547,   561,   577,   579,   584,   591,   592,   593,   596,
  288.    598,   602,   605,   618,   622,   630,   637,   644,   653,   656,
  289.    657,   660,   662,   677,   678,   678,   679,   681,   682,   685,
  290.    688,   699,   705,   710,   710,   721,   727,   732,   734,   735,
  291.    738,   741,   744,   746,   750,   751,   754,   755,   759,   768,
  292.    770,   774,   775,   776,   777,   778,   782,   785,   785,   788,
  293.    790,   801,   801,   807,   809,   813,   814,   817,   819,   821,
  294.    839,   841,   845,   846,   848,   851,   853,   854,   855,   856,
  295.    857,   858,   859,   860,   861,   862,   863,   864,   865,   866,
  296.    867,   868,   869,   870,   871,   872,   873,   874,   875,   876,
  297.    877,   878,   879,   882,   883,   887,   888,   890,   894,   896,
  298.    898,   899,   900,   902,   905,   907,   909,   913,   914,   917,
  299.    919,   923,   924,   927,   929,   935,   938,   940,   954,   957,
  300.    958,   959,   962,   963,   966,   967,   970,   973,   974,   977,
  301.    980,   982,   984,   988,   992,   993,   996,  1000,  1001,  1004,
  302.   1009,  1013,  1014,  1017,  1018,  1019,  1022,  1027,  1028,  1031,
  303.   1033,  1038,  1041,  1050,  1056,  1073,  1090,  1094,  1097,  1102,
  304.   1106,  1109,  1114
  305. };
  306.  
  307. static const char * const yytname[] = {   "$","error","$undefined.","array_tok",
  308. "begin_tok","case_tok","const_tok","do_tok","downto_tok","else_tok","end_tok",
  309. "file_tok","for_tok","function_tok","goto_tok","if_tok","label_tok","of_tok",
  310. "procedure_tok","program_tok","record_tok","repeat_tok","then_tok","to_tok",
  311. "type_tok","until_tok","var_tok","while_tok","others_tok","r_num_tok","i_num_tok",
  312. "string_literal_tok","single_char_tok","assign_tok","two_dots_tok","undef_id_tok",
  313. "var_id_tok","proc_id_tok","proc_param_tok","fun_id_tok","fun_param_tok","const_id_tok",
  314. "type_id_tok","hhb0_tok","hhb1_tok","field_id_tok","define_tok","field_tok",
  315. "break_tok","'='","not_eq_tok","'<'","'>'","less_eq_tok","great_eq_tok","'+'",
  316. "'-'","or_tok","unary_plus_tok","unary_minus_tok","'*'","'/'","div_tok","mod_tok",
  317. "and_tok","not_tok","';'","'('","')'","','","'^'","'['","']'","':'","'.'","PROGRAM",
  318. "@1","@2","DEFS","DEF","PROGRAM_HEAD","BLOCK","@3","@4","@5","LABEL_DEC_PART",
  319. "@6","LABEL_LIST","LABEL","CONST_DEC_PART","CONST_DEC_LIST","CONST_DEC","@7",
  320. "@8","CONSTANT","STRING","CONSTANT_ID","TYPE_DEC_PART","TYPE_DEF_LIST","TYPE_DEF",
  321. "@9","@10","@11","TYPE","SIMPLE_TYPE","SUBRANGE_TYPE","POSSIBLE_PLUS","SUB_CONSTANT",
  322. "TYPE_ID","STRUCTURED_TYPE","POINTER_TYPE","ARRAY_TYPE","INDEX_TYPE","COMPONENT_TYPE",
  323. "RECORD_TYPE","@12","FIELD_LIST","RECORD_SECTION","@13","@14","FIELD_ID_LIST",
  324. "FIELD_ID","FILE_TYPE","@15","VAR_DEC_PART","VAR_DEC_LIST","VAR_DEC","@16","@17",
  325. "VAR_ID_DEC_LIST","VAR_ID","BODY","@18","P_F_DEC_PART","P_F_DEC","PROCEDURE_DEC",
  326. "PROCEDURE_HEAD","@19","@20","PARAM","@21","FORM_PAR_SEC_L","FORM_PAR_SEC1",
  327. "@22","FORM_PAR_SEC","@23","@24","DECLARED_PROC","FUNCTION_DEC","FUNCTION_HEAD",
  328. "@25","@26","@27","@28","@29","@30","DECLARED_FUN","RESULT_TYPE","STAT_PART",
  329. "COMPOUND_STAT","@31","STAT_LIST","STATEMENT","S_LABEL","UNLAB_STAT","SIMPLE_STAT",
  330. "ASSIGN_STAT","@32","@33","VARIABLE","@34","FUNC_ID_AS","VAR_DESIG_LIST","VAR_DESIG",
  331. "@35","VAR_DESIG1","@36","EXPRESS","@37","@38","@39","@40","@41","@42","@43",
  332. "@44","@45","@46","@47","@48","@49","@50","UNARY_OP","FACTOR","@51","@52","PARAM_LIST",
  333. "@53","ACTUAL_PARAM_L","@54","ACTUAL_PARAM","WIDTH_FIELD","PROC_STAT","@55",
  334. "GO_TO_STAT","EMPTY_STAT","STRUCT_STAT","CONDIT_STAT","IF_STATEMENT","BEGIN_IF_STAT",
  335. "@56","@57","ELSE_STAT","@58","CASE_STATEMENT","@59","@60","CASE_EL_LIST","CASE_ELEMENT",
  336. "CASE_LAB_LIST","CASE_LAB","END_CASE","REPETIT_STAT","WHILE_STATEMENT","@61",
  337. "@62","REP_STATEMENT","@63","@64","FOR_STATEMENT","@65","@66","@67","CONTROL_VAR",
  338. "FOR_LIST","@68","@69","@70","@71",""
  339. };
  340. #endif
  341.  
  342. static const short yyr1[] = {     0,
  343.     76,    77,    75,    78,    78,    79,    79,    79,    79,    79,
  344.     79,    79,    79,    79,    80,    82,    83,    84,    81,    85,
  345.     86,    85,    87,    87,    88,    89,    89,    90,    90,    92,
  346.     93,    91,    94,    94,    94,    94,    95,    95,    96,    97,
  347.     97,    98,    98,   100,   101,   102,    99,   103,   103,   104,
  348.    104,   105,   106,   106,   107,   107,   108,   109,   109,   109,
  349.    109,   110,   111,   111,   112,   112,   113,   115,   114,   116,
  350.    116,   118,   119,   117,   117,   120,   120,   121,   121,   123,
  351.    122,   124,   124,   125,   125,   127,   128,   126,   129,   129,
  352.    130,   130,   130,   131,   132,   131,   133,   133,   133,   134,
  353.    134,   135,   137,   136,   138,   136,   139,   140,   139,   141,
  354.    141,   143,   142,   145,   144,   146,   144,   147,   147,   148,
  355.    150,   151,   152,   149,   153,   154,   155,   149,   156,   156,
  356.    157,   158,   160,   159,   161,   161,   162,   162,   163,   164,
  357.    164,   165,   165,   165,   165,   165,   167,   166,   168,   166,
  358.    170,   169,   169,   171,   171,   172,   172,   174,   173,   173,
  359.    173,   173,   175,   176,   175,   177,   178,   177,   179,   177,
  360.    180,   177,   181,   177,   182,   177,   183,   177,   184,   177,
  361.    185,   177,   186,   177,   187,   177,   188,   177,   189,   177,
  362.    190,   177,   191,   177,   177,   192,   192,   192,   194,   193,
  363.    193,   193,   193,   195,   193,   197,   196,   198,   199,   198,
  364.    200,   201,   201,   202,   202,   203,   202,   204,   205,   206,
  365.    206,   206,   207,   207,   208,   208,   210,   211,   209,   213,
  366.    212,   215,   216,   214,   217,   217,   218,   219,   219,   220,
  367.    220,   221,   221,   222,   222,   222,   224,   225,   223,   227,
  368.    228,   226,   230,   231,   232,   229,   233,   235,   236,   234,
  369.    237,   238,   234
  370. };
  371.  
  372. static const short yyr2[] = {     0,
  373.      0,     0,    10,     0,     2,     4,     4,     4,     6,     4,
  374.      6,     4,     6,     4,     3,     0,     0,     0,     8,     0,
  375.      0,     4,     1,     3,     1,     0,     2,     1,     2,     0,
  376.      0,     6,     1,     1,     1,     1,     1,     1,     1,     0,
  377.      2,     1,     2,     0,     0,     0,     7,     1,     1,     1,
  378.      1,     3,     0,     1,     2,     1,     1,     1,     1,     1,
  379.      1,     2,     6,     8,     1,     1,     1,     0,     4,     1,
  380.      3,     0,     0,     5,     0,     1,     3,     1,     1,     0,
  381.      4,     0,     2,     1,     2,     0,     0,     6,     1,     3,
  382.      1,     1,     1,     0,     0,     5,     0,     1,     2,     2,
  383.      2,     2,     0,     5,     0,     5,     0,     0,     4,     1,
  384.      3,     0,     4,     0,     2,     0,     3,     1,     1,     2,
  385.      0,     0,     0,     9,     0,     0,     0,     9,     1,     1,
  386.      1,     3,     0,     4,     1,     3,     1,     3,     1,     1,
  387.      1,     1,     1,     1,     1,     1,     0,     4,     0,     4,
  388.      0,     3,     1,     1,     1,     1,     2,     0,     4,     2,
  389.      2,     2,     1,     0,     4,     2,     0,     4,     0,     4,
  390.      0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
  391.      0,     4,     0,     4,     0,     4,     0,     4,     0,     4,
  392.      0,     4,     0,     4,     1,     1,     1,     1,     0,     4,
  393.      1,     1,     1,     0,     3,     0,     4,     1,     0,     4,
  394.      2,     2,     0,     1,     1,     0,     3,     2,     0,     1,
  395.      1,     1,     1,     1,     1,     2,     0,     0,     6,     0,
  396.      3,     0,     0,     7,     1,     3,     3,     1,     3,     1,
  397.      1,     1,     2,     1,     1,     1,     0,     0,     6,     0,
  398.      0,     6,     0,     0,     0,     9,     1,     0,     0,     5,
  399.      0,     0,     5
  400. };
  401.  
  402. static const short yydefact[] = {     4,
  403.      0,     0,     0,     5,     1,     0,     0,     0,     0,     0,
  404.      0,     0,    20,    15,     0,     0,     0,     0,     0,     0,
  405.     21,    26,     8,     7,     0,    10,     0,    53,    12,    14,
  406.      6,     0,    30,    40,     0,     0,    56,    54,     0,     0,
  407.      0,    25,     0,    23,    27,    28,     0,    44,    82,     9,
  408.     11,    13,    55,    53,    22,     0,    29,    31,    41,    42,
  409.      0,    86,     2,    52,    24,     0,    43,    45,    83,    84,
  410.      0,    97,     0,     0,    85,    91,    92,    93,     0,    89,
  411.      0,     0,    94,    98,     0,    16,     0,    16,    34,    33,
  412.     37,    38,    39,     0,    35,    36,    46,     0,    87,   121,
  413.    129,   130,   125,   103,   118,   119,   105,    95,     3,    99,
  414.    100,   102,    20,   101,   120,    32,    53,    90,    53,   107,
  415.    107,   107,   107,   219,    26,     0,     0,    68,    57,     0,
  416.      0,    48,    50,    51,    49,    61,    58,    59,    60,     0,
  417.    108,     0,     0,     0,     0,   133,   232,   253,     0,   227,
  418.    250,   247,   139,   215,   153,   214,   216,   154,   155,   146,
  419.    220,     0,   135,     0,   137,   140,   142,     0,     0,   143,
  420.    144,   145,   141,   221,   223,   225,   224,   222,   244,   245,
  421.    246,    40,    53,    80,    72,    62,    47,    88,   114,   122,
  422.    126,   104,   106,   219,     0,     0,   218,     0,   219,     0,
  423.      0,     0,     0,   219,   219,   147,   149,   230,   226,    17,
  424.     66,    65,     0,    53,     0,    70,     0,   116,     0,   110,
  425.    112,    53,    53,     0,   203,   204,   196,   197,   198,   199,
  426.    202,   201,     0,     0,   195,   257,     0,   228,     0,   248,
  427.    158,     0,   152,   156,   206,   217,    96,   136,   138,     0,
  428.      0,   219,    82,    53,     0,    81,    69,    72,    78,    79,
  429.      0,    76,   112,   114,   109,   115,     0,   131,   123,   127,
  430.    134,     0,     0,   233,   175,   177,   181,   183,   185,   187,
  431.    167,   169,   191,   171,   193,   173,   179,   189,   166,   254,
  432.      0,   251,     0,     0,   161,   162,   160,   157,     0,   148,
  433.    150,   231,    18,     0,    53,    71,     0,    73,   117,   111,
  434.      0,     0,     0,   205,     0,     0,     0,     0,     0,     0,
  435.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  436.      0,   219,     0,   219,     0,   213,     0,   208,     0,     0,
  437.     67,    63,    77,    53,     0,   124,   128,   200,   241,   240,
  438.      0,   235,     0,   238,   176,   178,   182,   184,   186,   188,
  439.    168,   170,   192,   172,   194,   174,   180,   190,   258,     0,
  440.    229,   252,   249,   164,   163,   159,     0,   211,   207,   209,
  441.    219,    19,    53,    74,   113,   242,     0,   234,     0,   219,
  442.      0,     0,   255,     0,   212,     0,     0,    64,   243,   236,
  443.    239,   237,   259,   262,   219,     0,   210,   132,     0,     0,
  444.    256,   165,   260,   263,     0,     0,     0
  445. };
  446.  
  447. static const short yydefgoto[] = {   415,
  448.     13,    72,     1,     4,     5,   112,   113,   253,   339,    22,
  449.     32,    43,    44,    34,    45,    46,    47,    66,   231,    95,
  450.     96,    49,    59,    60,    61,    74,   117,   268,   132,   133,
  451.     40,    41,   134,   135,   136,   137,   213,   342,   138,   185,
  452.    215,   216,   217,   344,   261,   262,   139,   214,    63,    69,
  453.     70,    71,   119,    79,    80,   109,   124,    83,    84,    85,
  454.     86,   122,   123,   142,   189,   219,   266,   267,   220,   221,
  455.    263,   107,    87,    88,   120,   222,   312,   121,   223,   313,
  456.    103,   269,   382,   161,   194,   162,   163,   164,   165,   166,
  457.    167,   250,   251,   232,   201,   169,   243,   244,   294,   376,
  458.    394,   336,   323,   324,   326,   328,   317,   318,   329,   319,
  459.    320,   321,   322,   330,   325,   327,   234,   235,   273,   272,
  460.    246,   299,   337,   396,   338,   378,   170,   202,   171,   172,
  461.    173,   174,   175,   176,   198,   291,   209,   252,   177,   195,
  462.    316,   351,   352,   353,   354,   388,   178,   179,   200,   293,
  463.    180,   199,   333,   181,   196,   331,   405,   237,   370,   391,
  464.    409,   392,   410
  465. };
  466.  
  467. static const short yypact[] = {-32768,
  468.      4,   -29,    27,-32768,-32768,   -47,    20,    33,    52,    62,
  469.     72,   114,   141,-32768,   108,    53,    60,    16,   112,   122,
  470. -32768,   158,-32768,-32768,   132,-32768,   139,    28,-32768,-32768,
  471. -32768,   187,-32768,   167,   157,   160,-32768,-32768,   165,   190,
  472.    204,-32768,    78,-32768,   212,-32768,   213,-32768,   235,-32768,
  473. -32768,-32768,-32768,    28,-32768,   187,-32768,-32768,   224,-32768,
  474.    227,-32768,-32768,-32768,-32768,   214,-32768,-32768,   117,-32768,
  475.    120,    43,   184,   215,-32768,-32768,-32768,-32768,    35,-32768,
  476.     44,   142,   150,-32768,   199,-32768,   205,-32768,-32768,-32768,
  477. -32768,-32768,-32768,   206,-32768,-32768,-32768,   120,-32768,-32768,
  478. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  479. -32768,-32768,   141,-32768,-32768,-32768,     2,-32768,     2,   203,
  480.    203,   203,   203,   146,   158,   202,   259,-32768,-32768,   232,
  481.    225,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   226,
  482. -32768,   207,   228,   234,   237,-32768,-32768,-32768,   248,-32768,
  483. -32768,-32768,-32768,-32768,    98,-32768,-32768,-32768,-32768,-32768,
  484. -32768,    -2,-32768,   231,-32768,-32768,-32768,   246,   265,-32768,
  485. -32768,-32768,-32768,-32768,-32768,   290,-32768,-32768,-32768,-32768,
  486. -32768,   167,     0,-32768,     1,-32768,-32768,-32768,   289,-32768,
  487. -32768,-32768,-32768,   146,   210,   280,-32768,   210,   146,   210,
  488.    119,   255,   249,   146,   197,-32768,-32768,-32768,-32768,-32768,
  489. -32768,-32768,   123,     2,     5,-32768,    14,-32768,   161,-32768,
  490. -32768,     2,     2,     7,-32768,-32768,-32768,-32768,-32768,-32768,
  491. -32768,-32768,    61,   210,-32768,-32768,   291,   301,    -9,   301,
  492. -32768,   154,   119,-32768,-32768,-32768,-32768,-32768,-32768,   210,
  493.    210,   146,   235,     0,   308,-32768,-32768,     1,-32768,-32768,
  494.     36,-32768,-32768,   289,-32768,-32768,   120,-32768,-32768,-32768,
  495. -32768,   255,   210,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  496. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  497.    304,-32768,   320,   210,-32768,-32768,-32768,-32768,   210,   301,
  498.    301,-32768,-32768,   256,     2,-32768,    14,-32768,-32768,-32768,
  499.     97,   273,   274,-32768,   281,   230,   210,   210,   210,   210,
  500.    210,   210,   210,   210,   210,   210,   210,   210,   210,   210,
  501.    210,   146,   210,   146,   233,   -25,   175,-32768,   342,   330,
  502. -32768,-32768,-32768,     2,   306,-32768,-32768,-32768,-32768,-32768,
  503.     10,-32768,   102,-32768,   317,   317,   317,   317,   317,   317,
  504.    192,   192,   192,-32768,-32768,-32768,-32768,-32768,    39,   352,
  505. -32768,   301,-32768,-32768,-32768,-32768,   345,-32768,-32768,-32768,
  506.    146,-32768,     2,-32768,-32768,-32768,    24,-32768,   230,   197,
  507.    337,   368,-32768,   210,-32768,   210,    11,-32768,-32768,-32768,
  508. -32768,-32768,-32768,-32768,   146,   257,-32768,-32768,   210,   210,
  509. -32768,-32768,   301,   301,   382,   383,-32768
  510. };
  511.  
  512. static const short yypgoto[] = {-32768,
  513. -32768,-32768,-32768,-32768,-32768,   296,-32768,-32768,-32768,   272,
  514. -32768,-32768,   331,   261,-32768,   343,-32768,-32768,   316,-32768,
  515. -32768,   208,-32768,   332,-32768,-32768,-32768,  -116,-32768,   -24,
  516. -32768,   338,-32768,-32768,-32768,-32768,   140,    12,-32768,-32768,
  517. -32768,   135,-32768,-32768,-32768,    89,-32768,-32768,   144,-32768,
  518.    329,-32768,-32768,   133,   303,-32768,-32768,-32768,   319,-32768,
  519. -32768,-32768,-32768,    82,-32768,-32768,   136,-32768,   143,-32768,
  520. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  521. -32768,   180,-32768,-32768,-32768,  -185,  -186,-32768,  -203,-32768,
  522. -32768,-32768,-32768,  -124,-32768,-32768,-32768,   162,-32768,-32768,
  523. -32768,  -188,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  524. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  525.    134,-32768,-32768,-32768,     8,-32768,-32768,-32768,-32768,-32768,
  526. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  527. -32768,-32768,    21,-32768,    22,-32768,-32768,-32768,-32768,-32768,
  528. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  529. -32768,-32768,-32768
  530. };
  531.  
  532.  
  533. #define    YYLAST        411
  534.  
  535.  
  536. static const short yytable[] = {   168,
  537.    131,   249,   140,    39,   126,     6,   233,   203,   224,   238,
  538.    -75,   240,   127,   239,   257,   292,   271,   248,    14,   386,
  539.    408,   128,     2,   275,   276,   277,   278,   279,   280,   281,
  540.    282,   283,     7,   399,   284,   285,   286,   287,   288,     8,
  541.     37,   211,    37,   129,     9,   289,  -261,   377,   259,     3,
  542.     10,   349,    11,   350,    15,    81,   204,    38,   260,    38,
  543.     82,   300,   301,   204,    28,   302,   -75,    16,    37,   168,
  544.    258,   130,   204,    12,   168,   387,   204,   274,   100,   168,
  545.    168,    29,   101,   102,   315,    38,    17,   275,   276,   277,
  546.    278,   279,   280,   281,   282,   283,    18,   256,   284,   285,
  547.    286,   287,   288,    98,   307,   335,    19,    99,   308,   275,
  548.    276,   277,   278,   279,   280,   281,   282,   283,    24,    25,
  549.    284,   285,   286,   287,   288,    26,    27,   168,   355,   356,
  550.    357,   358,   359,   360,   361,   362,   363,   364,   365,   366,
  551.    367,   368,   369,    55,   372,   371,    56,   373,    20,   146,
  552.    147,   -86,   -86,   108,    76,    77,    21,   148,   212,   149,
  553.    150,   -86,    81,    33,    78,    98,   151,    82,  -151,   345,
  554.    389,  -151,   152,    23,   390,   153,   104,    30,   105,   106,
  555.    154,   155,   156,   157,   158,   159,   402,    31,   341,   241,
  556.     48,   254,   242,   160,   255,   397,   295,   296,   297,    35,
  557.    146,   147,   143,   144,   145,   406,    36,   168,   148,   168,
  558.    149,   150,    89,    90,    91,    92,    42,   151,   411,    53,
  559.    413,   414,    50,   152,    93,    51,   264,   384,   265,   212,
  560.     52,   154,   155,   156,   157,   158,   159,    54,    89,    90,
  561.     91,    92,   379,   380,   160,   155,   -30,    58,   225,   226,
  562.     93,   284,   285,   286,   287,   288,   168,   349,   -44,   350,
  563.     62,    68,    73,    97,   111,   168,   341,   227,   228,   141,
  564.    114,   116,   183,   186,   229,   184,   230,   197,   206,   190,
  565.    168,   275,   276,   277,   278,   279,   280,   281,   282,   283,
  566.    187,   188,   284,   285,   286,   287,   288,   207,   208,   192,
  567.    191,   374,   193,   205,   375,   275,   276,   277,   278,   279,
  568.    280,   281,   282,   283,   218,   236,   284,   285,   286,   287,
  569.    288,   245,   247,   290,   305,   332,   334,   340,   412,   275,
  570.    276,   277,   278,   279,   280,   281,   282,   283,   346,   347,
  571.    284,   285,   286,   287,   288,   381,   383,   385,   348,   275,
  572.    276,   277,   278,   279,   280,   281,   282,   283,   393,   403,
  573.    284,   285,   286,   287,   288,-32768,-32768,-32768,-32768,-32768,
  574. -32768,   281,   282,   283,   395,   404,   284,   285,   286,   287,
  575.    288,   416,   417,   115,   125,   182,    65,    57,    94,   210,
  576.     67,    64,   306,   304,   398,   343,   303,    75,   309,   311,
  577.    118,   110,   270,   407,   298,   314,   310,   400,     0,     0,
  578.    401
  579. };
  580.  
  581. static const short yycheck[] = {   124,
  582.    117,   205,   119,    28,     3,    35,   195,    10,   194,   198,
  583.     10,   200,    11,   199,    10,    25,    10,   204,    66,    10,
  584.     10,    20,    19,    49,    50,    51,    52,    53,    54,    55,
  585.     56,    57,     6,    10,    60,    61,    62,    63,    64,    13,
  586.     41,    42,    41,    42,    18,   234,     8,    73,    35,    46,
  587.     24,    28,    26,    30,    35,    13,    66,    58,    45,    58,
  588.     18,   250,   251,    66,    49,   252,    66,    35,    41,   194,
  589.     66,    70,    66,    47,   199,    66,    66,    17,    35,   204,
  590.    205,    66,    39,    40,   273,    58,    35,    49,    50,    51,
  591.     52,    53,    54,    55,    56,    57,    35,   214,    60,    61,
  592.     62,    63,    64,    69,    69,   294,    35,    73,    73,    49,
  593.     50,    51,    52,    53,    54,    55,    56,    57,    66,    67,
  594.     60,    61,    62,    63,    64,    66,    67,   252,   317,   318,
  595.    319,   320,   321,   322,   323,   324,   325,   326,   327,   328,
  596.    329,   330,   331,    66,   333,   332,    69,   334,    35,     4,
  597.      5,    35,    36,     4,    35,    36,    16,    12,   183,    14,
  598.     15,    45,    13,     6,    45,    69,    21,    18,    71,    73,
  599.     69,    74,    27,    66,    73,    30,    35,    66,    37,    38,
  600.     35,    36,    37,    38,    39,    40,   390,    66,   305,    71,
  601.     24,    69,    74,    48,    72,   381,    43,    44,    45,    68,
  602.      4,     5,   121,   122,   123,   394,    68,   332,    12,   334,
  603.     14,    15,    29,    30,    31,    32,    30,    21,   405,    30,
  604.    409,   410,    66,    27,    41,    66,    66,   344,    68,   254,
  605.     66,    35,    36,    37,    38,    39,    40,    34,    29,    30,
  606.     31,    32,    68,    69,    48,    36,    35,    35,    39,    40,
  607.     41,    60,    61,    62,    63,    64,   381,    28,    35,    30,
  608.     26,    35,    49,    49,    66,   390,   383,    58,    59,    67,
  609.     66,    66,    71,    42,    65,    17,    67,    30,    33,    73,
  610.    405,    49,    50,    51,    52,    53,    54,    55,    56,    57,
  611.     66,    66,    60,    61,    62,    63,    64,    33,     9,    66,
  612.     73,    69,    66,    73,    72,    49,    50,    51,    52,    53,
  613.     54,    55,    56,    57,    26,    36,    60,    61,    62,    63,
  614.     64,    67,    74,    33,    17,    22,     7,    72,    72,    49,
  615.     50,    51,    52,    53,    54,    55,    56,    57,    66,    66,
  616.     60,    61,    62,    63,    64,     4,    17,    42,    68,    49,
  617.     50,    51,    52,    53,    54,    55,    56,    57,     7,    23,
  618.     60,    61,    62,    63,    64,    49,    50,    51,    52,    53,
  619.     54,    55,    56,    57,    30,     8,    60,    61,    62,    63,
  620.     64,     0,     0,    88,   113,   125,    56,    45,    73,   182,
  621.     59,    54,   258,   254,   383,   307,   253,    69,   263,   267,
  622.     98,    83,   223,   396,   243,   272,   264,   387,    -1,    -1,
  623.    389
  624. };
  625. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  626. #line 3 "Lib:bison.simple"
  627.  
  628. /* Skeleton output parser for bison,
  629.    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
  630.  
  631.    This program is free software; you can redistribute it and/or modify
  632.    it under the terms of the GNU General Public License as published by
  633.    the Free Software Foundation; either version 2, or (at your option)
  634.    any later version.
  635.  
  636.    This program is distributed in the hope that it will be useful,
  637.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  638.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  639.    GNU General Public License for more details.
  640.  
  641.    You should have received a copy of the GNU General Public License
  642.    along with this program; if not, write to the Free Software
  643.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  644.  
  645. /* As a special exception, when this file is copied by Bison into a
  646.    Bison output file, you may use that output file without restriction.
  647.    This special exception was added by the Free Software Foundation
  648.    in version 1.24 of Bison.  */
  649.  
  650. #ifndef alloca
  651. #include <alloca.h>
  652. #endif /* alloca not defined.  */
  653.  
  654. /* This is the parser code that is written into each bison parser
  655.   when the %semantic_parser declaration is not specified in the grammar.
  656.   It was written by Richard Stallman by simplifying the hairy parser
  657.   used when %semantic_parser is specified.  */
  658.  
  659. /* Note: there must be only one dollar sign in this file.
  660.    It is replaced by the list of actions, each action
  661.    as one case of the switch.  */
  662.  
  663. #define yyerrok        (yyerrstatus = 0)
  664. #define yyclearin    (yychar = YYEMPTY)
  665. #define YYEMPTY        -2
  666. #define YYEOF        0
  667. #define YYACCEPT    return(0)
  668. #define YYABORT     return(1)
  669. #define YYERROR        goto yyerrlab1
  670. /* Like YYERROR except do call yyerror.
  671.    This remains here temporarily to ease the
  672.    transition to the new meaning of YYERROR, for GCC.
  673.    Once GCC version 2 has supplanted version 1, this can go.  */
  674. #define YYFAIL        goto yyerrlab
  675. #define YYRECOVERING()  (!!yyerrstatus)
  676. #define YYBACKUP(token, value) \
  677. do                                \
  678.   if (yychar == YYEMPTY && yylen == 1)                \
  679.     { yychar = (token), yylval = (value);            \
  680.       yychar1 = YYTRANSLATE (yychar);                \
  681.       YYPOPSTACK;                        \
  682.       goto yybackup;                        \
  683.     }                                \
  684.   else                                \
  685.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  686. while (0)
  687.  
  688. #define YYTERROR    1
  689. #define YYERRCODE    256
  690.  
  691. #ifndef YYPURE
  692. #define YYLEX        yylex()
  693. #endif
  694.  
  695. #ifdef YYPURE
  696. #ifdef YYLSP_NEEDED
  697. #ifdef YYLEX_PARAM
  698. #define YYLEX        yylex(&yylval, &yylloc, YYLEX_PARAM)
  699. #else
  700. #define YYLEX        yylex(&yylval, &yylloc)
  701. #endif
  702. #else /* not YYLSP_NEEDED */
  703. #ifdef YYLEX_PARAM
  704. #define YYLEX        yylex(&yylval, YYLEX_PARAM)
  705. #else
  706. #define YYLEX        yylex(&yylval)
  707. #endif
  708. #endif /* not YYLSP_NEEDED */
  709. #endif
  710.  
  711. /* If nonreentrant, generate the variables here */
  712.  
  713. #ifndef YYPURE
  714.  
  715. int    yychar;            /*  the lookahead symbol        */
  716. YYSTYPE    yylval;            /*  the semantic value of the        */
  717.                 /*  lookahead symbol            */
  718.  
  719. #ifdef YYLSP_NEEDED
  720. YYLTYPE yylloc;            /*  location data for the lookahead    */
  721.                 /*  symbol                */
  722. #endif
  723.  
  724. int yynerrs;            /*  number of parse errors so far       */
  725. #endif  /* not YYPURE */
  726.  
  727. #if YYDEBUG != 0
  728. int yydebug;            /*  nonzero means print parse trace    */
  729. /* Since this is uninitialized, it does not stop multiple parsers
  730.    from coexisting.  */
  731. #endif
  732.  
  733. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  734.  
  735. #ifndef    YYINITDEPTH
  736. #define YYINITDEPTH 200
  737. #endif
  738.  
  739. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  740.     (effective only if the built-in stack extension method is used).  */
  741. #ifdef YYMAXDEPTH
  742. #if YYMAXDEPTH == 0
  743. #undef YYMAXDEPTH
  744. #endif /* YYMAXDEPTH ==0 */
  745. #endif /* def YYMAXDEPTH */
  746. #ifndef YYMAXDEPTH
  747. #define YYMAXDEPTH 10000
  748. #endif
  749.  
  750. /* Prevent warning if -Wstrict-prototypes.  */
  751. #ifdef __GNUC__
  752. int yyparse (void);
  753. #endif
  754.  
  755. #ifndef __riscos
  756. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  757. #define __yy_memcpy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  758. #else                /* not GNU C or C++ */
  759. #ifndef __cplusplus
  760.  
  761. /* This is the most reliable way to avoid incompatibilities
  762.    in available built-in functions on various systems.  */
  763. static void
  764. __yy_memcpy (from, to, count)
  765.      char *from;
  766.      char *to;
  767.      int count;
  768. {
  769.   register char *f = from;
  770.   register char *t = to;
  771.   register int i = count;
  772.  
  773.   while (i-- > 0)
  774.     *t++ = *f++;
  775. }
  776.  
  777. #else /* __cplusplus */
  778.  
  779. /* This is the most reliable way to avoid incompatibilities
  780.    in available built-in functions on various systems.  */
  781. static void
  782. __yy_memcpy (char *from, char *to, int count)
  783. {
  784.   register char *f = from;
  785.   register char *t = to;
  786.   register int i = count;
  787.  
  788.   while (i-- > 0)
  789.     *t++ = *f++;
  790. }
  791.  
  792. #endif
  793. #endif
  794. #else /* __riscos */
  795. #include <string.h>
  796. #define __yy_memcpy(FROM,TO,COUNT) (memcpy(TO,FROM,COUNT))
  797. #endif /* __riscos */
  798.  
  799. #line 176 "Lib:bison.simple"
  800.  
  801. /* The user can define YYPARSE_PARAM as the name of an argument to be passed
  802.    into yyparse.  The argument should have type void *.
  803.    It should actually point to an object.
  804.    Grammar actions can access the variable by casting it
  805.    to the proper pointer type.  */
  806.  
  807. #ifdef YYPARSE_PARAM
  808. #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
  809. #else
  810. #define YYPARSE_PARAM
  811. #define YYPARSE_PARAM_DECL
  812. #endif
  813.  
  814. int
  815. yyparse(YYPARSE_PARAM)
  816.      YYPARSE_PARAM_DECL
  817. {
  818.   register int yystate;
  819.   register int yyn;
  820.   register short *yyssp;
  821.   register YYSTYPE *yyvsp;
  822.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  823.   int yychar1 = 0;        /*  lookahead token as an internal (translated) token number */
  824.  
  825.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  826.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  827.  
  828.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  829.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  830.  
  831. #ifdef YYLSP_NEEDED
  832.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  833.   YYLTYPE *yyls = yylsa;
  834.   YYLTYPE *yylsp;
  835.  
  836. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  837. #else
  838. #define YYPOPSTACK   (yyvsp--, yyssp--)
  839. #endif
  840.  
  841.   int yystacksize = YYINITDEPTH;
  842.  
  843. #ifdef YYPURE
  844.   int yychar;
  845.   YYSTYPE yylval;
  846.   int yynerrs;
  847. #ifdef YYLSP_NEEDED
  848.   YYLTYPE yylloc;
  849. #endif
  850. #endif
  851.  
  852.   YYSTYPE yyval;        /*  the variable used to return        */
  853.                 /*  semantic values from the action    */
  854.                 /*  routines                */
  855.  
  856.   int yylen;
  857.  
  858. #if YYDEBUG != 0
  859.   if (yydebug)
  860.     fprintf(stderr, "Starting parse\n");
  861. #endif
  862.  
  863.   yystate = 0;
  864.   yyerrstatus = 0;
  865.   yynerrs = 0;
  866.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  867.  
  868.   /* Initialize stack pointers.
  869.      Waste one element of value and location stack
  870.      so that they stay on the same level as the state stack.
  871.      The wasted elements are never initialized.  */
  872.  
  873.   yyssp = yyss - 1;
  874.   yyvsp = yyvs;
  875. #ifdef YYLSP_NEEDED
  876.   yylsp = yyls;
  877. #endif
  878.  
  879. /* Push a new state, which is found in  yystate  .  */
  880. /* In all cases, when you get here, the value and location stacks
  881.    have just been pushed. so pushing a state here evens the stacks.  */
  882. yynewstate:
  883.  
  884.   *++yyssp = yystate;
  885.  
  886.   if (yyssp >= yyss + yystacksize - 1)
  887.     {
  888.       /* Give user a chance to reallocate the stack */
  889.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  890.       YYSTYPE *yyvs1 = yyvs;
  891.       short *yyss1 = yyss;
  892. #ifdef YYLSP_NEEDED
  893.       YYLTYPE *yyls1 = yyls;
  894. #endif
  895.  
  896.       /* Get the current used size of the three stacks, in elements.  */
  897.       int size = yyssp - yyss + 1;
  898.  
  899. #ifdef yyoverflow
  900.       /* Each stack pointer address is followed by the size of
  901.      the data in use in that stack, in bytes.  */
  902. #ifdef YYLSP_NEEDED
  903.       /* This used to be a conditional around just the two extra args,
  904.      but that might be undefined if yyoverflow is a macro.  */
  905.       yyoverflow("parser stack overflow",
  906.          &yyss1, size * sizeof (*yyssp),
  907.          &yyvs1, size * sizeof (*yyvsp),
  908.          &yyls1, size * sizeof (*yylsp),
  909.          &yystacksize);
  910. #else
  911.       yyoverflow("parser stack overflow",
  912.          &yyss1, size * sizeof (*yyssp),
  913.          &yyvs1, size * sizeof (*yyvsp),
  914.          &yystacksize);
  915. #endif
  916.  
  917.       yyss = yyss1; yyvs = yyvs1;
  918. #ifdef YYLSP_NEEDED
  919.       yyls = yyls1;
  920. #endif
  921. #else /* no yyoverflow */
  922.       /* Extend the stack our own way.  */
  923.       if (yystacksize >= YYMAXDEPTH)
  924.     {
  925.       yyerror("parser stack overflow");
  926.       return 2;
  927.     }
  928.       yystacksize *= 2;
  929.       if (yystacksize > YYMAXDEPTH)
  930.     yystacksize = YYMAXDEPTH;
  931.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  932.       __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  933.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  934.       __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  935. #ifdef YYLSP_NEEDED
  936.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  937.       __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  938. #endif
  939. #endif /* no yyoverflow */
  940.  
  941.       yyssp = yyss + size - 1;
  942.       yyvsp = yyvs + size - 1;
  943. #ifdef YYLSP_NEEDED
  944.       yylsp = yyls + size - 1;
  945. #endif
  946.  
  947. #if YYDEBUG != 0
  948.       if (yydebug)
  949.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  950. #endif
  951.  
  952.       if (yyssp >= yyss + yystacksize - 1)
  953.     YYABORT;
  954.     }
  955.  
  956. #if YYDEBUG != 0
  957.   if (yydebug)
  958.     fprintf(stderr, "Entering state %d\n", yystate);
  959. #endif
  960.  
  961.   goto yybackup;
  962.  yybackup:
  963.  
  964. /* Do appropriate processing given the current state.  */
  965. /* Read a lookahead token if we need one and don't already have one.  */
  966. /* yyresume: */
  967.  
  968.   /* First try to decide what to do without reference to lookahead token.  */
  969.  
  970.   yyn = yypact[yystate];
  971.   if (yyn == YYFLAG)
  972.     goto yydefault;
  973.  
  974.   /* Not known => get a lookahead token if don't already have one.  */
  975.  
  976.   /* yychar is either YYEMPTY or YYEOF
  977.      or a valid token in external form.  */
  978.  
  979.   if (yychar == YYEMPTY)
  980.     {
  981. #if YYDEBUG != 0
  982.       if (yydebug)
  983.     fprintf(stderr, "Reading a token: ");
  984. #endif
  985.       yychar = YYLEX;
  986.     }
  987.  
  988.   /* Convert token to internal form (in yychar1) for indexing tables with */
  989.  
  990.   if (yychar <= 0)        /* This means end of input. */
  991.     {
  992.       yychar1 = 0;
  993.       yychar = YYEOF;        /* Don't call YYLEX any more */
  994.  
  995. #if YYDEBUG != 0
  996.       if (yydebug)
  997.     fprintf(stderr, "Now at end of input.\n");
  998. #endif
  999.     }
  1000.   else
  1001.     {
  1002.       yychar1 = YYTRANSLATE(yychar);
  1003.  
  1004. #if YYDEBUG != 0
  1005.       if (yydebug)
  1006.     {
  1007.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  1008.       /* Give the individual parser a way to print the precise meaning
  1009.          of a token, for further debugging info.  */
  1010. #ifdef YYPRINT
  1011.       YYPRINT (stderr, yychar, yylval);
  1012. #endif
  1013.       fprintf (stderr, ")\n");
  1014.     }
  1015. #endif
  1016.     }
  1017.  
  1018.   yyn += yychar1;
  1019.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  1020.     goto yydefault;
  1021.  
  1022.   yyn = yytable[yyn];
  1023.  
  1024.   /* yyn is what to do for this token type in this state.
  1025.      Negative => reduce, -yyn is rule number.
  1026.      Positive => shift, yyn is new state.
  1027.        New state is final state => don't bother to shift,
  1028.        just return success.
  1029.      0, or most negative number => error.  */
  1030.  
  1031.   if (yyn < 0)
  1032.     {
  1033.       if (yyn == YYFLAG)
  1034.     goto yyerrlab;
  1035.       yyn = -yyn;
  1036.       goto yyreduce;
  1037.     }
  1038.   else if (yyn == 0)
  1039.     goto yyerrlab;
  1040.  
  1041.   if (yyn == YYFINAL)
  1042.     YYACCEPT;
  1043.  
  1044.   /* Shift the lookahead token.  */
  1045.  
  1046. #if YYDEBUG != 0
  1047.   if (yydebug)
  1048.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  1049. #endif
  1050.  
  1051.   /* Discard the token being shifted unless it is eof.  */
  1052.   if (yychar != YYEOF)
  1053.     yychar = YYEMPTY;
  1054.  
  1055.   *++yyvsp = yylval;
  1056. #ifdef YYLSP_NEEDED
  1057.   *++yylsp = yylloc;
  1058. #endif
  1059.  
  1060.   /* count tokens shifted since error; after three, turn off error status.  */
  1061.   if (yyerrstatus) yyerrstatus--;
  1062.  
  1063.   yystate = yyn;
  1064.   goto yynewstate;
  1065.  
  1066. /* Do the default action for the current state.  */
  1067. yydefault:
  1068.  
  1069.   yyn = yydefact[yystate];
  1070.   if (yyn == 0)
  1071.     goto yyerrlab;
  1072.  
  1073. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  1074. yyreduce:
  1075.   yylen = yyr2[yyn];
  1076.   if (yylen > 0)
  1077.     yyval = yyvsp[1-yylen]; /* implement default value of the action */
  1078.  
  1079. #if YYDEBUG != 0
  1080.   if (yydebug)
  1081.     {
  1082.       int i;
  1083.  
  1084.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  1085.            yyn, yyrline[yyn]);
  1086.  
  1087.       /* Print the symbols being reduced, and their result.  */
  1088.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  1089.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  1090.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  1091.     }
  1092. #endif
  1093.  
  1094.  
  1095.   switch (yyn) {
  1096.  
  1097. case 1:
  1098. #line 58 "y.web2c"
  1099. { block_level++;
  1100.          printf ("#include \"%s\"\n", std_header);
  1101.       ;
  1102.     break;}
  1103. case 2:
  1104. #line 63 "y.web2c"
  1105. { printf ("\n#include \"%s\"\n", coerce_name); ;
  1106.     break;}
  1107. case 3:
  1108. #line 66 "y.web2c"
  1109. { YYACCEPT; ;
  1110.     break;}
  1111. case 6:
  1112. #line 76 "y.web2c"
  1113. {
  1114.           ii = add_to_table (last_id); 
  1115.           sym_table[ii].typ = field_id_tok;
  1116.         ;
  1117.     break;}
  1118. case 7:
  1119. #line 81 "y.web2c"
  1120. {
  1121.           ii = add_to_table (last_id); 
  1122.           sym_table[ii].typ = fun_id_tok;
  1123.         ;
  1124.     break;}
  1125. case 8:
  1126. #line 86 "y.web2c"
  1127. {
  1128.           ii = add_to_table (last_id); 
  1129.           sym_table[ii].typ = const_id_tok;
  1130.         ;
  1131.     break;}
  1132. case 9:
  1133. #line 91 "y.web2c"
  1134. {
  1135.           ii = add_to_table (last_id); 
  1136.           sym_table[ii].typ = fun_param_tok;
  1137.         ;
  1138.     break;}
  1139. case 10:
  1140. #line 96 "y.web2c"
  1141. {
  1142.           ii = add_to_table (last_id); 
  1143.           sym_table[ii].typ = proc_id_tok;
  1144.         ;
  1145.     break;}
  1146. case 11:
  1147. #line 101 "y.web2c"
  1148. {
  1149.           ii = add_to_table (last_id); 
  1150.           sym_table[ii].typ = proc_param_tok;
  1151.         ;
  1152.     break;}
  1153. case 12:
  1154. #line 106 "y.web2c"
  1155. {
  1156.           ii = add_to_table (last_id); 
  1157.           sym_table[ii].typ = type_id_tok;
  1158.         ;
  1159.     break;}
  1160. case 13:
  1161. #line 111 "y.web2c"
  1162. {
  1163.           ii = add_to_table (last_id); 
  1164.           sym_table[ii].typ = type_id_tok;
  1165.           sym_table[ii].val = lower_bound;
  1166.           sym_table[ii].val_sym = lower_sym;
  1167.           sym_table[ii].upper = upper_bound;
  1168.           sym_table[ii].upper_sym = upper_sym;
  1169.         ;
  1170.     break;}
  1171. case 14:
  1172. #line 120 "y.web2c"
  1173. {
  1174.           ii = add_to_table (last_id); 
  1175.           sym_table[ii].typ = var_id_tok;
  1176.         ;
  1177.     break;}
  1178. case 16:
  1179. #line 131 "y.web2c"
  1180. {    if (block_level > 0) my_output("{");
  1181.             indent++; block_level++;
  1182.               ;
  1183.     break;}
  1184. case 17:
  1185. #line 136 "y.web2c"
  1186. {if (block_level == 2) {
  1187.                 if (strcmp(fn_return_type, "void")) {
  1188.                   my_output("register");
  1189.                   my_output(fn_return_type);
  1190.                   my_output("Result;");
  1191.                 }
  1192.                 if (tex) {
  1193.                   (void) sprintf(safe_string, "%s_regmem",
  1194.                         my_routine);
  1195.                   my_output(safe_string);
  1196.                   indent_line();
  1197.                 }
  1198.              }
  1199.             ;
  1200.     break;}
  1201. case 18:
  1202. #line 151 "y.web2c"
  1203. {if (block_level == 1)
  1204.                 puts("\n#include \"coerce.h\"");
  1205.              doing_statements = true;
  1206.             ;
  1207.     break;}
  1208. case 19:
  1209. #line 156 "y.web2c"
  1210. {if (block_level == 2) {
  1211.                 if (strcmp(fn_return_type,"void")) {
  1212.                   my_output("return(Result)");
  1213.                   semicolon();
  1214.                  }
  1215.                  if (tex) {
  1216.                    if (uses_mem && uses_eqtb)
  1217.                 (void) fprintf(coerce,
  1218.     "#define %s_regmem register memoryword *mem=zmem, *eqtb=zeqtb;\n",
  1219.                    my_routine);
  1220.                    else if (uses_mem)
  1221.                 (void) fprintf(coerce,
  1222.             "#define %s_regmem register memoryword *mem=zmem;\n",
  1223.                    my_routine);
  1224.                    else if (uses_eqtb)
  1225.                 (void) fprintf(coerce,
  1226.             "#define %s_regmem register memoryword *eqtb=zeqtb;\n",
  1227.                    my_routine);
  1228.                    else
  1229.                 (void) fprintf(coerce,
  1230.                    "#define %s_regmem\n",
  1231.                    my_routine);
  1232.                 }
  1233.                 my_routine[0] = '\0';
  1234.              }
  1235.              indent--; block_level--;
  1236.              my_output("}"); new_line();
  1237.              doing_statements = false;
  1238.             ;
  1239.     break;}
  1240. case 21:
  1241. #line 189 "y.web2c"
  1242. { my_output("/*"); ;
  1243.     break;}
  1244. case 22:
  1245. #line 191 "y.web2c"
  1246. { my_output("*/"); ;
  1247.     break;}
  1248. case 25:
  1249. #line 199 "y.web2c"
  1250. { my_output(temp); ;
  1251.     break;}
  1252. case 27:
  1253. #line 204 "y.web2c"
  1254. { indent_line(); ;
  1255.     break;}
  1256. case 30:
  1257. #line 212 "y.web2c"
  1258. { new_line(); my_output("#define"); ;
  1259.     break;}
  1260. case 31:
  1261. #line 214 "y.web2c"
  1262. { ii=add_to_table(last_id);
  1263.                   sym_table[ii].typ = const_id_tok;
  1264.                   my_output(last_id);
  1265.                 ;
  1266.     break;}
  1267. case 32:
  1268. #line 219 "y.web2c"
  1269. { sym_table[ii].val=last_i_num;
  1270.                   new_line(); ;
  1271.     break;}
  1272. case 33:
  1273. #line 224 "y.web2c"
  1274. {
  1275.                   (void) sscanf(temp, "%ld", &last_i_num);
  1276.                   if (my_labs((long) last_i_num) > 32767)
  1277.                       (void) strcat(temp, "L");
  1278.                   my_output(temp);
  1279.                   yyval = ex_32;
  1280.                 ;
  1281.     break;}
  1282. case 34:
  1283. #line 232 "y.web2c"
  1284. { my_output(temp);
  1285.                   yyval = ex_real;
  1286.                 ;
  1287.     break;}
  1288. case 35:
  1289. #line 236 "y.web2c"
  1290. { yyval = 0; ;
  1291.     break;}
  1292. case 36:
  1293. #line 238 "y.web2c"
  1294. { yyval = ex_32; ;
  1295.     break;}
  1296. case 37:
  1297. #line 242 "y.web2c"
  1298. { int i, j; char s[132];
  1299.                     j = 1;
  1300.                   s[0] = '"';
  1301.                     for (i=1; yytext[i-1]!=0; i++) {
  1302.                       if (yytext[i] == '\\' || yytext[i] == '"')
  1303.                     s[j++]='\\';
  1304.                         else if (yytext[i] == '\'') i++;
  1305.                         s[j++] = yytext[i];
  1306.                   }
  1307.                       s[j-1] = '"';
  1308.                   s[j] = 0;
  1309.                   my_output(s);
  1310.                 ;
  1311.     break;}
  1312. case 38:
  1313. #line 256 "y.web2c"
  1314. { char s[5];
  1315.                   s[0]='\'';
  1316.                       if (yytext[1] == '\\' || yytext[1] == '\'') {
  1317.                       s[2] = yytext[1];
  1318.                     s[1] = '\\';
  1319.                     s[3] = '\'';
  1320.                     s[4] = '\0';
  1321.                   }
  1322.                     else {
  1323.                     s[1] = yytext[1];
  1324.                     s[2]='\'';
  1325.                     s[3]='\0';
  1326.                   }
  1327.                     my_output(s);
  1328.                 ;
  1329.     break;}
  1330. case 39:
  1331. #line 274 "y.web2c"
  1332. { my_output(last_id); ;
  1333.     break;}
  1334. case 44:
  1335. #line 286 "y.web2c"
  1336. { my_output("typedef"); ;
  1337.     break;}
  1338. case 45:
  1339. #line 288 "y.web2c"
  1340. { ii = add_to_table(last_id);
  1341.                   sym_table[ii].typ = type_id_tok;
  1342.                   (void) strcpy(safe_string, last_id);
  1343.                   last_type = ii;
  1344.                 ;
  1345.     break;}
  1346. case 46:
  1347. #line 294 "y.web2c"
  1348. {
  1349.                   array_bounds[0] = 0;
  1350.                   array_offset[0] = 0;
  1351.                 ;
  1352.     break;}
  1353. case 47:
  1354. #line 299 "y.web2c"
  1355. { if (*array_offset) {
  1356.             fprintf(stderr, "Cannot typedef arrays with offsets\n");
  1357.                     exit(1);
  1358.                   }
  1359.                   my_output(safe_string);
  1360.                   my_output(array_bounds);
  1361.                   semicolon();
  1362.                   last_type = -1;
  1363.                 ;
  1364.     break;}
  1365. case 50:
  1366. #line 316 "y.web2c"
  1367. {
  1368.               if (last_type >= 0)
  1369.                 {
  1370.                    sym_table[ii].val = lower_bound;
  1371.                    sym_table[ii].val_sym = lower_sym;
  1372.                    sym_table[ii].upper = upper_bound;
  1373.                    sym_table[ii].upper_sym = upper_sym;
  1374.                    ii= -1;
  1375.                  }
  1376.                  
  1377.               /* If the bounds on an integral type are known at
  1378.                  translation time, select the smallest ANSI C type which
  1379.                  can represent it.  We avoid using unsigned char and
  1380.                  unsigned short where possible, as ANSI compilers
  1381.                  (typically) convert them to int, while traditional
  1382.                  compilers convert them to unsigned int.  We also avoid
  1383.                  schar if possible, since it also is different on
  1384.                  different compilers (see config.h).  */
  1385.               if (lower_sym == -1 && upper_sym == -1)
  1386.                 {
  1387.                   if (0 <= lower_bound && upper_bound <= SCHAR_MAX)
  1388.                     my_output ("char");
  1389.                   else if (SCHAR_MIN <= lower_bound && upper_bound <=SCHAR_MAX)
  1390.                     my_output ("schar");
  1391.                   else if (0 <= lower_bound && upper_bound <= UCHAR_MAX)
  1392.                     my_output ("unsigned char");
  1393.          #ifndef RISCOS /* Jakob Stoklund Olesen 15. Mar 1998 */
  1394.                   else if (SHRT_MIN <= lower_bound && upper_bound <= SHRT_MAX)
  1395.                     my_output ("short");
  1396.                   else if (0 <= lower_bound && upper_bound <= USHRT_MAX)
  1397.                     my_output ("unsigned short");
  1398.          #endif /* RISCOS */
  1399.                   else
  1400.                     my_output ("integer");
  1401.                 }
  1402.               else
  1403.                 my_output ("integer");
  1404.             ;
  1405.     break;}
  1406. case 55:
  1407. #line 366 "y.web2c"
  1408. {lower_bound = upper_bound;
  1409.                  lower_sym = upper_sym;
  1410.                  (void) sscanf(temp, "%ld", &upper_bound);
  1411.                  upper_sym = -1; /* no sym table entry */
  1412.                 ;
  1413.     break;}
  1414. case 56:
  1415. #line 372 "y.web2c"
  1416. { lower_bound = upper_bound;
  1417.                   lower_sym = upper_sym;
  1418.                   upper_bound = sym_table[l_s].val;
  1419.                   upper_sym = l_s;
  1420.                 ;
  1421.     break;}
  1422. case 57:
  1423. #line 380 "y.web2c"
  1424. {if (last_type >= 0) {
  1425.         sym_table[last_type].var_not_needed = sym_table[l_s].var_not_needed;
  1426.         sym_table[last_type].upper = sym_table[l_s].upper;
  1427.         sym_table[last_type].upper_sym = sym_table[l_s].upper_sym;
  1428.         sym_table[last_type].val = sym_table[l_s].val;
  1429.         sym_table[last_type].val_sym = sym_table[l_s].val_sym;
  1430.      }
  1431.      my_output(last_id); ;
  1432.     break;}
  1433. case 58:
  1434. #line 392 "y.web2c"
  1435. { if (last_type >= 0)
  1436.             sym_table[last_type].var_not_needed = true;
  1437.             ;
  1438.     break;}
  1439. case 60:
  1440. #line 397 "y.web2c"
  1441. { if (last_type >= 0)
  1442.             sym_table[last_type].var_not_needed = true;
  1443.             ;
  1444.     break;}
  1445. case 61:
  1446. #line 401 "y.web2c"
  1447. { if (last_type >= 0)
  1448.             sym_table[last_type].var_not_needed = true;
  1449.             ;
  1450.     break;}
  1451. case 62:
  1452. #line 407 "y.web2c"
  1453. {if (last_type >= 0) {
  1454.         sym_table[last_type].var_not_needed = sym_table[l_s].var_not_needed;
  1455.         sym_table[last_type].upper = sym_table[l_s].upper;
  1456.         sym_table[last_type].upper_sym = sym_table[l_s].upper_sym;
  1457.         sym_table[last_type].val = sym_table[l_s].val;
  1458.         sym_table[last_type].val_sym = sym_table[l_s].val_sym;
  1459.      }
  1460.      my_output(last_id); my_output("*"); ;
  1461.     break;}
  1462. case 65:
  1463. #line 423 "y.web2c"
  1464. { compute_array_bounds(); ;
  1465.     break;}
  1466. case 66:
  1467. #line 425 "y.web2c"
  1468. { lower_bound = sym_table[l_s].val;
  1469.                   lower_sym = sym_table[l_s].val_sym;
  1470.                   upper_bound = sym_table[l_s].upper;
  1471.                   upper_sym = sym_table[l_s].upper_sym;
  1472.                   compute_array_bounds();
  1473.                 ;
  1474.     break;}
  1475. case 68:
  1476. #line 438 "y.web2c"
  1477. { my_output("struct"); my_output("{"); indent++;;
  1478.     break;}
  1479. case 69:
  1480. #line 440 "y.web2c"
  1481. { indent--; my_output("}"); semicolon(); ;
  1482.     break;}
  1483. case 72:
  1484. #line 448 "y.web2c"
  1485. { field_list[0] = 0; ;
  1486.     break;}
  1487. case 73:
  1488. #line 450 "y.web2c"
  1489. {
  1490.                   /*array_bounds[0] = 0;
  1491.                   array_offset[0] = 0;*/
  1492.                 ;
  1493.     break;}
  1494. case 74:
  1495. #line 455 "y.web2c"
  1496. { int i=0, j; char ltemp[80];
  1497.                   while(field_list[i++] == '!') {
  1498.                     j = 0;
  1499.                     while (field_list[i])
  1500.                         ltemp[j++] = field_list[i++];
  1501.                     i++;
  1502.                     if (field_list[i] == '!')
  1503.                         ltemp[j++] = ',';
  1504.                     ltemp[j] = 0;
  1505.                     my_output(ltemp);
  1506.                   }
  1507.                   semicolon();
  1508.                 ;
  1509.     break;}
  1510. case 78:
  1511. #line 476 "y.web2c"
  1512. { int i=0, j=0;
  1513.                   while (field_list[i] == '!')
  1514.                     while(field_list[i++]);
  1515.                   ii = add_to_table(last_id);
  1516.                   sym_table[ii].typ = field_id_tok;
  1517.                   field_list[i++] = '!';
  1518.                   while (last_id[j])
  1519.                     field_list[i++] = last_id[j++];
  1520.                   field_list[i++] = 0;
  1521.                   field_list[i++] = 0;
  1522.                 ;
  1523.     break;}
  1524. case 79:
  1525. #line 488 "y.web2c"
  1526. { int i=0, j=0;
  1527.                   while (field_list[i] == '!')
  1528.                     while(field_list[i++]);
  1529.                   field_list[i++] = '!';
  1530.                   while (last_id[j])
  1531.                     field_list[i++] = last_id[j++];
  1532.                   field_list[i++] = 0;
  1533.                   field_list[i++] = 0;
  1534.                 ;
  1535.     break;}
  1536. case 80:
  1537. #line 500 "y.web2c"
  1538. { my_output("file_ptr /* of "); ;
  1539.     break;}
  1540. case 81:
  1541. #line 502 "y.web2c"
  1542. { my_output("*/"); ;
  1543.     break;}
  1544. case 86:
  1545. #line 514 "y.web2c"
  1546. { var_list[0] = 0;
  1547.           array_bounds[0] = 0;
  1548.           array_offset[0] = 0;
  1549.           var_formals = false;
  1550.           ids_paramed = 0;
  1551.         ;
  1552.     break;}
  1553. case 87:
  1554. #line 521 "y.web2c"
  1555. {
  1556.           array_bounds[0] = 0;    
  1557.           array_offset[0] = 0;
  1558.         ;
  1559.     break;}
  1560. case 88:
  1561. #line 526 "y.web2c"
  1562. { fixup_var_list(); ;
  1563.     break;}
  1564. case 91:
  1565. #line 534 "y.web2c"
  1566. { int i=0, j=0;
  1567.                   ii = add_to_table(last_id);
  1568.                   sym_table[ii].typ = var_id_tok;
  1569.                   sym_table[ii].var_formal = var_formals;
  1570.                   param_id_list[ids_paramed++] = ii;
  1571.                     while (var_list[i] == '!')
  1572.                     while(var_list[i++]);
  1573.                   var_list[i++] = '!';
  1574.                   while (last_id[j])
  1575.                     var_list[i++] = last_id[j++];
  1576.                     var_list[i++] = 0;
  1577.                   var_list[i++] = 0;
  1578.                 ;
  1579.     break;}
  1580. case 92:
  1581. #line 548 "y.web2c"
  1582. { int i=0, j=0;
  1583.                   ii = add_to_table(last_id);
  1584.                     sym_table[ii].typ = var_id_tok;
  1585.                   sym_table[ii].var_formal = var_formals;
  1586.                   param_id_list[ids_paramed++] = ii;
  1587.                     while (var_list[i] == '!')
  1588.                     while (var_list[i++]);
  1589.                     var_list[i++] = '!';
  1590.                   while (last_id[j])
  1591.                     var_list[i++] = last_id[j++];
  1592.                     var_list[i++] = 0;
  1593.                   var_list[i++] = 0;
  1594.                 ;
  1595.     break;}
  1596. case 93:
  1597. #line 562 "y.web2c"
  1598. { int i=0, j=0;
  1599.                   ii = add_to_table(last_id);
  1600.                     sym_table[ii].typ = var_id_tok;
  1601.                   sym_table[ii].var_formal = var_formals;
  1602.                   param_id_list[ids_paramed++] = ii;
  1603.                     while (var_list[i] == '!')
  1604.                     while(var_list[i++]);
  1605.                     var_list[i++] = '!';
  1606.                   while (last_id[j])
  1607.                     var_list[i++] = last_id[j++];
  1608.                   var_list[i++] = 0;
  1609.                   var_list[i++] = 0;
  1610.                 ;
  1611.     break;}
  1612. case 95:
  1613. #line 580 "y.web2c"
  1614. { my_output ("void main_body() {");
  1615.           indent++;
  1616.           new_line ();
  1617.         ;
  1618.     break;}
  1619. case 96:
  1620. #line 585 "y.web2c"
  1621. { indent--;
  1622.                   my_output ("}");
  1623.                   new_line ();
  1624.                 ;
  1625.     break;}
  1626. case 100:
  1627. #line 597 "y.web2c"
  1628. { indent_line(); remove_locals(); ;
  1629.     break;}
  1630. case 101:
  1631. #line 599 "y.web2c"
  1632. { indent_line(); remove_locals(); ;
  1633.     break;}
  1634. case 103:
  1635. #line 607 "y.web2c"
  1636. { ii = add_to_table(last_id);
  1637.           if (debug)
  1638.             (void) fprintf(stderr, "%3d Procedure %s\n",
  1639.                   pf_count++, last_id);
  1640.           sym_table[ii].typ = proc_id_tok;
  1641.           (void) strcpy(my_routine, last_id);
  1642.           uses_eqtb = uses_mem = false;
  1643.           my_output("void");
  1644.           orig_std = std;
  1645.           std = 0;
  1646.         ;
  1647.     break;}
  1648. case 104:
  1649. #line 619 "y.web2c"
  1650. { (void) strcpy(fn_return_type, "void");
  1651.           do_proc_args();
  1652.           gen_function_head();;
  1653.     break;}
  1654. case 105:
  1655. #line 623 "y.web2c"
  1656. { ii = l_s; 
  1657.           if (debug)
  1658.             (void) fprintf(stderr, "%3d Procedure %s\n",
  1659.                                pf_count++, last_id);
  1660.           (void) strcpy(my_routine, last_id);
  1661.           my_output("void");
  1662.         ;
  1663.     break;}
  1664. case 106:
  1665. #line 631 "y.web2c"
  1666. { (void) strcpy(fn_return_type, "void");
  1667.           do_proc_args();
  1668.           gen_function_head();
  1669.             ;
  1670.     break;}
  1671. case 107:
  1672. #line 639 "y.web2c"
  1673. {
  1674.               (void) strcpy (z_id, last_id);
  1675.           mark ();
  1676.           ids_paramed = 0;
  1677.         ;
  1678.     break;}
  1679. case 108:
  1680. #line 645 "y.web2c"
  1681. { sprintf (z_id, "z%s", last_id);
  1682.           ids_paramed = 0;
  1683.           if (sym_table[ii].typ == proc_id_tok)
  1684.             sym_table[ii].typ = proc_param_tok;
  1685.           else if (sym_table[ii].typ == fun_id_tok)
  1686.             sym_table[ii].typ = fun_param_tok;
  1687.           mark();
  1688.         ;
  1689.     break;}
  1690. case 112:
  1691. #line 661 "y.web2c"
  1692. { ids_typed = ids_paramed;;
  1693.     break;}
  1694. case 113:
  1695. #line 663 "y.web2c"
  1696. { int i, need_var;
  1697.           i = search_table(last_id);
  1698.           need_var = !sym_table[i].var_not_needed;
  1699.           for (i=ids_typed; i<ids_paramed; i++)
  1700.                 {
  1701.               (void) strcpy(arg_type[i], last_id);
  1702.           if (need_var && sym_table[param_id_list[i]].var_formal)
  1703.                 (void) strcat(arg_type[i], " *");
  1704.           else
  1705.                     sym_table[param_id_list[i]].var_formal = false;
  1706.             }
  1707.         ;
  1708.     break;}
  1709. case 114:
  1710. #line 677 "y.web2c"
  1711. {var_formals = 0;;
  1712.     break;}
  1713. case 116:
  1714. #line 678 "y.web2c"
  1715. {var_formals = 1;;
  1716.     break;}
  1717. case 121:
  1718. #line 689 "y.web2c"
  1719. { orig_std = std;
  1720.                   std = 0;
  1721.                   ii = add_to_table(last_id);
  1722.                   if (debug)
  1723.                   (void) fprintf(stderr, "%3d Function %s\n",
  1724.                     pf_count++, last_id);
  1725.                     sym_table[ii].typ = fun_id_tok;
  1726.                   (void) strcpy(my_routine, last_id);
  1727.                   uses_eqtb = uses_mem = false;
  1728.                 ;
  1729.     break;}
  1730. case 122:
  1731. #line 700 "y.web2c"
  1732. { normal();
  1733.                   array_bounds[0] = 0;
  1734.                   array_offset[0] = 0;
  1735.                 ;
  1736.     break;}
  1737. case 123:
  1738. #line 705 "y.web2c"
  1739. {(void) strcpy(fn_return_type, yytext);
  1740.                  do_proc_args();
  1741.                  gen_function_head();
  1742.                 ;
  1743.     break;}
  1744. case 125:
  1745. #line 712 "y.web2c"
  1746. { orig_std = std;
  1747.                   std = 0;
  1748.                   ii = l_s;
  1749.                   if (debug)
  1750.                   (void) fprintf(stderr, "%3d Function %s\n",
  1751.                     pf_count++, last_id);
  1752.                   (void) strcpy(my_routine, last_id);
  1753.                   uses_eqtb = uses_mem = false;
  1754.                 ;
  1755.     break;}
  1756. case 126:
  1757. #line 722 "y.web2c"
  1758. { normal();
  1759.                   array_bounds[0] = 0;
  1760.                   array_offset[0] = 0;
  1761.                 ;
  1762.     break;}
  1763. case 127:
  1764. #line 727 "y.web2c"
  1765. {(void) strcpy(fn_return_type, yytext);
  1766.                  do_proc_args();
  1767.                  gen_function_head();
  1768.                 ;
  1769.     break;}
  1770. case 133:
  1771. #line 745 "y.web2c"
  1772. {my_output("{"); indent++; new_line();;
  1773.     break;}
  1774. case 134:
  1775. #line 747 "y.web2c"
  1776. { indent--; my_output("}"); new_line(); ;
  1777.     break;}
  1778. case 139:
  1779. #line 760 "y.web2c"
  1780. {if (!doreturn(temp)) {
  1781.                     (void) sprintf(safe_string, "lab%s:",
  1782.                     temp);
  1783.                     my_output(safe_string);
  1784.                  }
  1785.                 ;
  1786.     break;}
  1787. case 140:
  1788. #line 769 "y.web2c"
  1789. { semicolon(); ;
  1790.     break;}
  1791. case 141:
  1792. #line 771 "y.web2c"
  1793. { semicolon(); ;
  1794.     break;}
  1795. case 146:
  1796. #line 779 "y.web2c"
  1797. {my_output("break");;
  1798.     break;}
  1799. case 147:
  1800. #line 783 "y.web2c"
  1801. { my_output("="); ;
  1802.     break;}
  1803. case 149:
  1804. #line 786 "y.web2c"
  1805. { my_output("Result ="); ;
  1806.     break;}
  1807. case 151:
  1808. #line 791 "y.web2c"
  1809. { if (strcmp(last_id, "mem") == 0)
  1810.                     uses_mem = 1;
  1811.                   else if (strcmp(last_id, "eqtb") == 0)
  1812.                     uses_eqtb = 1;
  1813.                   if (sym_table[l_s].var_formal)
  1814.                     (void) putchar('*');
  1815.                   my_output(last_id);
  1816.                   yyval = ex_32;
  1817.                 ;
  1818.     break;}
  1819. case 153:
  1820. #line 802 "y.web2c"
  1821. { if (sym_table[l_s].var_formal)
  1822.                     (void) putchar('*');
  1823.                   my_output(last_id); yyval = ex_32; ;
  1824.     break;}
  1825. case 154:
  1826. #line 808 "y.web2c"
  1827. { yyval = ex_32; ;
  1828.     break;}
  1829. case 155:
  1830. #line 810 "y.web2c"
  1831. { yyval = ex_32; ;
  1832.     break;}
  1833. case 158:
  1834. #line 818 "y.web2c"
  1835. { my_output("["); ;
  1836.     break;}
  1837. case 159:
  1838. #line 820 "y.web2c"
  1839. { my_output("]"); ;
  1840.     break;}
  1841. case 160:
  1842. #line 822 "y.web2c"
  1843. {if (tex || mf) {
  1844.                    if (strcmp(last_id, "int")==0)
  1845.                     my_output(".cint");
  1846.                    else if (strcmp(last_id, "lh")==0)
  1847.                     my_output(".v.LH");
  1848.                    else if (strcmp(last_id, "rh")==0)
  1849.                     my_output(".v.RH");
  1850.                    else {
  1851.                      (void)sprintf(safe_string, ".%s", last_id);
  1852.                      my_output(safe_string);
  1853.                    }
  1854.                  }
  1855.                  else {
  1856.                     (void) sprintf(safe_string, ".%s", last_id);
  1857.                     my_output(safe_string);
  1858.                  }
  1859.                 ;
  1860.     break;}
  1861. case 161:
  1862. #line 840 "y.web2c"
  1863. { my_output(".hh.b0");;
  1864.     break;}
  1865. case 162:
  1866. #line 842 "y.web2c"
  1867. { my_output(".hh.b1");;
  1868.     break;}
  1869. case 164:
  1870. #line 847 "y.web2c"
  1871. { my_output("][");;
  1872.     break;}
  1873. case 166:
  1874. #line 852 "y.web2c"
  1875. { yyval = yyvsp[0]; ;
  1876.     break;}
  1877. case 167:
  1878. #line 853 "y.web2c"
  1879. {my_output("+");;
  1880.     break;}
  1881. case 168:
  1882. #line 854 "y.web2c"
  1883. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1884.     break;}
  1885. case 169:
  1886. #line 855 "y.web2c"
  1887. {my_output("-");;
  1888.     break;}
  1889. case 170:
  1890. #line 856 "y.web2c"
  1891. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1892.     break;}
  1893. case 171:
  1894. #line 857 "y.web2c"
  1895. {my_output("*");;
  1896.     break;}
  1897. case 172:
  1898. #line 858 "y.web2c"
  1899. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1900.     break;}
  1901. case 173:
  1902. #line 859 "y.web2c"
  1903. {my_output("/");;
  1904.     break;}
  1905. case 174:
  1906. #line 860 "y.web2c"
  1907. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1908.     break;}
  1909. case 175:
  1910. #line 861 "y.web2c"
  1911. {my_output("==");;
  1912.     break;}
  1913. case 176:
  1914. #line 862 "y.web2c"
  1915. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1916.     break;}
  1917. case 177:
  1918. #line 863 "y.web2c"
  1919. {my_output("!=");;
  1920.     break;}
  1921. case 178:
  1922. #line 864 "y.web2c"
  1923. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1924.     break;}
  1925. case 179:
  1926. #line 865 "y.web2c"
  1927. {my_output("%");;
  1928.     break;}
  1929. case 180:
  1930. #line 866 "y.web2c"
  1931. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1932.     break;}
  1933. case 181:
  1934. #line 867 "y.web2c"
  1935. {my_output("<");;
  1936.     break;}
  1937. case 182:
  1938. #line 868 "y.web2c"
  1939. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1940.     break;}
  1941. case 183:
  1942. #line 869 "y.web2c"
  1943. {my_output(">");;
  1944.     break;}
  1945. case 184:
  1946. #line 870 "y.web2c"
  1947. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1948.     break;}
  1949. case 185:
  1950. #line 871 "y.web2c"
  1951. {my_output("<=");;
  1952.     break;}
  1953. case 186:
  1954. #line 872 "y.web2c"
  1955. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1956.     break;}
  1957. case 187:
  1958. #line 873 "y.web2c"
  1959. {my_output(">=");;
  1960.     break;}
  1961. case 188:
  1962. #line 874 "y.web2c"
  1963. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1964.     break;}
  1965. case 189:
  1966. #line 875 "y.web2c"
  1967. {my_output("&&");;
  1968.     break;}
  1969. case 190:
  1970. #line 876 "y.web2c"
  1971. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1972.     break;}
  1973. case 191:
  1974. #line 877 "y.web2c"
  1975. {my_output("||");;
  1976.     break;}
  1977. case 192:
  1978. #line 878 "y.web2c"
  1979. {yyval = max(yyvsp[-3], yyvsp[0]);;
  1980.     break;}
  1981. case 193:
  1982. #line 880 "y.web2c"
  1983. { my_output("/ ((double)"); ;
  1984.     break;}
  1985. case 194:
  1986. #line 882 "y.web2c"
  1987. {yyval = max(yyvsp[-3], yyvsp[0]); my_output(")"); ;
  1988.     break;}
  1989. case 195:
  1990. #line 884 "y.web2c"
  1991. { yyval = yyvsp[0]; ;
  1992.     break;}
  1993. case 197:
  1994. #line 889 "y.web2c"
  1995. { my_output("- (integer)"); ;
  1996.     break;}
  1997. case 198:
  1998. #line 891 "y.web2c"
  1999. { my_output("!"); ;
  2000.     break;}
  2001. case 199:
  2002. #line 895 "y.web2c"
  2003. { my_output("("); ;
  2004.     break;}
  2005. case 200:
  2006. #line 897 "y.web2c"
  2007. { my_output(")"); yyval = yyvsp[-3]; ;
  2008.     break;}
  2009. case 203:
  2010. #line 901 "y.web2c"
  2011. { my_output(last_id); my_output("()"); ;
  2012.     break;}
  2013. case 204:
  2014. #line 903 "y.web2c"
  2015. { my_output(last_id); ;
  2016.     break;}
  2017. case 206:
  2018. #line 908 "y.web2c"
  2019. { my_output("("); ;
  2020.     break;}
  2021. case 207:
  2022. #line 910 "y.web2c"
  2023. { my_output(")"); ;
  2024.     break;}
  2025. case 209:
  2026. #line 915 "y.web2c"
  2027. { my_output(","); ;
  2028.     break;}
  2029. case 214:
  2030. #line 928 "y.web2c"
  2031. { my_output(last_id); my_output("()"); ;
  2032.     break;}
  2033. case 215:
  2034. #line 930 "y.web2c"
  2035. { my_output(last_id);
  2036.                   ii = add_to_table(last_id);
  2037.                     sym_table[ii].typ = proc_id_tok;
  2038.                   my_output("()");
  2039.                 ;
  2040.     break;}
  2041. case 216:
  2042. #line 936 "y.web2c"
  2043. { my_output(last_id); ;
  2044.     break;}
  2045. case 218:
  2046. #line 941 "y.web2c"
  2047. {if (doreturn(temp)) {
  2048.                     if (strcmp(fn_return_type,"void"))
  2049.                     my_output("return(Result)");
  2050.                     else
  2051.                     my_output("return");
  2052.                  } else {
  2053.                      (void) sprintf(safe_string, "goto lab%s",
  2054.                     temp);
  2055.                      my_output(safe_string);
  2056.                  }
  2057.                 ;
  2058.     break;}
  2059. case 227:
  2060. #line 971 "y.web2c"
  2061. { my_output("if"); my_output("("); ;
  2062.     break;}
  2063. case 228:
  2064. #line 973 "y.web2c"
  2065. { my_output(")"); new_line();;
  2066.     break;}
  2067. case 230:
  2068. #line 978 "y.web2c"
  2069. { my_output("else"); ;
  2070.     break;}
  2071. case 232:
  2072. #line 983 "y.web2c"
  2073. { my_output("switch"); my_output("("); ;
  2074.     break;}
  2075. case 233:
  2076. #line 985 "y.web2c"
  2077. { my_output(")"); indent_line();
  2078.                   my_output("{"); indent++;
  2079.                 ;
  2080.     break;}
  2081. case 234:
  2082. #line 989 "y.web2c"
  2083. { indent--; my_output("}"); new_line(); ;
  2084.     break;}
  2085. case 237:
  2086. #line 997 "y.web2c"
  2087. { my_output("break"); semicolon(); ;
  2088.     break;}
  2089. case 240:
  2090. #line 1005 "y.web2c"
  2091. { my_output("case"); 
  2092.                   my_output(temp);
  2093.                   my_output(":"); indent_line();
  2094.                 ;
  2095.     break;}
  2096. case 241:
  2097. #line 1010 "y.web2c"
  2098. { my_output("default:"); indent_line(); ;
  2099.     break;}
  2100. case 247:
  2101. #line 1023 "y.web2c"
  2102. { my_output("while");
  2103.                   my_output("(");
  2104.                 ;
  2105.     break;}
  2106. case 248:
  2107. #line 1027 "y.web2c"
  2108. { my_output(")"); ;
  2109.     break;}
  2110. case 250:
  2111. #line 1032 "y.web2c"
  2112. { my_output("do"); my_output("{"); indent++; ;
  2113.     break;}
  2114. case 251:
  2115. #line 1034 "y.web2c"
  2116. { indent--; my_output("}"); 
  2117.                   my_output("while"); my_output("( ! (");
  2118.                 ;
  2119.     break;}
  2120. case 252:
  2121. #line 1038 "y.web2c"
  2122. { my_output(") )"); ;
  2123.     break;}
  2124. case 253:
  2125. #line 1042 "y.web2c"
  2126. {
  2127.                   my_output("{");
  2128.                   my_output("register");
  2129.                   my_output("integer");
  2130.                   if (strict_for)
  2131.                     my_output("for_begin,");
  2132.                   my_output("for_end;");
  2133.                  ;
  2134.     break;}
  2135. case 254:
  2136. #line 1051 "y.web2c"
  2137. { if (strict_for)
  2138.                     my_output("for_begin");
  2139.                   else
  2140.                     my_output(control_var);
  2141.                   my_output("="); ;
  2142.     break;}
  2143. case 255:
  2144. #line 1057 "y.web2c"
  2145. { my_output("; if (");
  2146.                   if (strict_for) my_output("for_begin");
  2147.                   else my_output(control_var);
  2148.                   my_output(relation);
  2149.                   my_output("for_end)");
  2150.                   if (strict_for) {
  2151.                     my_output("{");
  2152.                     my_output(control_var);
  2153.                     my_output("=");
  2154.                     my_output("for_begin");
  2155.                     semicolon();
  2156.                   }
  2157.                   my_output("do"); 
  2158.                   indent++; 
  2159.                   new_line();;
  2160.     break;}
  2161. case 256:
  2162. #line 1073 "y.web2c"
  2163. {
  2164.                   char *top = strrchr (for_stack, '#');
  2165.                   indent--;
  2166.                                   new_line();
  2167.                   my_output("while"); 
  2168.                   my_output("("); 
  2169.                   my_output(top+1); 
  2170.                   my_output(")"); 
  2171.                   my_output(";");
  2172.                   my_output("}");
  2173.                   if (strict_for)
  2174.                     my_output("}");
  2175.                   *top=0;
  2176.                   new_line();
  2177.                 ;
  2178.     break;}
  2179. case 257:
  2180. #line 1091 "y.web2c"
  2181. {(void) strcpy(control_var, last_id); ;
  2182.     break;}
  2183. case 258:
  2184. #line 1095 "y.web2c"
  2185. { my_output(";"); ;
  2186.     break;}
  2187. case 259:
  2188. #line 1097 "y.web2c"
  2189.                   (void) strcpy(relation, "<=");
  2190.                   my_output("for_end");
  2191.                   my_output("="); ;
  2192.     break;}
  2193. case 260:
  2194. #line 1102 "y.web2c"
  2195.                   (void) sprintf(for_stack + strlen(for_stack),
  2196.                     "#%s++ < for_end", control_var);
  2197.                 ;
  2198.     break;}
  2199. case 261:
  2200. #line 1107 "y.web2c"
  2201. { my_output(";"); ;
  2202.     break;}
  2203. case 262:
  2204. #line 1109 "y.web2c"
  2205. {
  2206.                   (void) strcpy(relation, ">=");
  2207.                   my_output("for_end");
  2208.                   my_output("="); ;
  2209.     break;}
  2210. case 263:
  2211. #line 1114 "y.web2c"
  2212.                   (void) sprintf(for_stack + strlen(for_stack),
  2213.                     "#%s-- > for_end", control_var);
  2214.                 ;
  2215.     break;}
  2216. }
  2217.    /* the action file gets copied in in place of this dollarsign */
  2218. #line 472 "Lib:bison.simple"
  2219.  
  2220.   yyvsp -= yylen;
  2221.   yyssp -= yylen;
  2222. #ifdef YYLSP_NEEDED
  2223.   yylsp -= yylen;
  2224. #endif
  2225.  
  2226. #if YYDEBUG != 0
  2227.   if (yydebug)
  2228.     {
  2229.       short *ssp1 = yyss - 1;
  2230.       fprintf (stderr, "state stack now");
  2231.       while (ssp1 != yyssp)
  2232.     fprintf (stderr, " %d", *++ssp1);
  2233.       fprintf (stderr, "\n");
  2234.     }
  2235. #endif
  2236.  
  2237.   *++yyvsp = yyval;
  2238.  
  2239. #ifdef YYLSP_NEEDED
  2240.   yylsp++;
  2241.   if (yylen == 0)
  2242.     {
  2243.       yylsp->first_line = yylloc.first_line;
  2244.       yylsp->first_column = yylloc.first_column;
  2245.       yylsp->last_line = (yylsp-1)->last_line;
  2246.       yylsp->last_column = (yylsp-1)->last_column;
  2247.       yylsp->text = 0;
  2248.     }
  2249.   else
  2250.     {
  2251.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  2252.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  2253.     }
  2254. #endif
  2255.  
  2256.   /* Now "shift" the result of the reduction.
  2257.      Determine what state that goes to,
  2258.      based on the state we popped back to
  2259.      and the rule number reduced by.  */
  2260.  
  2261.   yyn = yyr1[yyn];
  2262.  
  2263.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  2264.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  2265.     yystate = yytable[yystate];
  2266.   else
  2267.     yystate = yydefgoto[yyn - YYNTBASE];
  2268.  
  2269.   goto yynewstate;
  2270.  
  2271. yyerrlab:   /* here on detecting error */
  2272.  
  2273.   if (! yyerrstatus)
  2274.     /* If not already recovering from an error, report this error.  */
  2275.     {
  2276.       ++yynerrs;
  2277.  
  2278. #ifdef YYERROR_VERBOSE
  2279.       yyn = yypact[yystate];
  2280.  
  2281.       if (yyn > YYFLAG && yyn < YYLAST)
  2282.     {
  2283.       int size = 0;
  2284.       char *msg;
  2285.       int x, count;
  2286.  
  2287.       count = 0;
  2288.       /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
  2289.       for (x = (yyn < 0 ? -yyn : 0);
  2290.            x < (sizeof(yytname) / sizeof(char *)); x++)
  2291.         if (yycheck[x + yyn] == x)
  2292.           size += strlen(yytname[x]) + 15, count++;
  2293.       msg = (char *) malloc(size + 15);
  2294.       if (msg != 0)
  2295.         {
  2296.           strcpy(msg, "parse error");
  2297.  
  2298.           if (count < 5)
  2299.         {
  2300.           count = 0;
  2301.           for (x = (yyn < 0 ? -yyn : 0);
  2302.                x < (sizeof(yytname) / sizeof(char *)); x++)
  2303.             if (yycheck[x + yyn] == x)
  2304.               {
  2305.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  2306.             strcat(msg, yytname[x]);
  2307.             strcat(msg, "'");
  2308.             count++;
  2309.               }
  2310.         }
  2311.           yyerror(msg);
  2312.           free(msg);
  2313.         }
  2314.       else
  2315.         yyerror ("parse error; also virtual memory exceeded");
  2316.     }
  2317.       else
  2318. #endif /* YYERROR_VERBOSE */
  2319.     yyerror("parse error");
  2320.     }
  2321.  
  2322.   goto yyerrlab1;
  2323. yyerrlab1:   /* here on error raised explicitly by an action */
  2324.  
  2325.   if (yyerrstatus == 3)
  2326.     {
  2327.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  2328.  
  2329.       /* return failure if at end of input */
  2330.       if (yychar == YYEOF)
  2331.     YYABORT;
  2332.  
  2333. #if YYDEBUG != 0
  2334.       if (yydebug)
  2335.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  2336. #endif
  2337.  
  2338.       yychar = YYEMPTY;
  2339.     }
  2340.  
  2341.   /* Else will try to reuse lookahead token
  2342.      after shifting the error token.  */
  2343.  
  2344.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  2345.  
  2346.   goto yyerrhandle;
  2347.  
  2348. yyerrdefault:  /* current state does not do anything special for the error token. */
  2349.  
  2350. #if 0
  2351.   /* This is wrong; only states that explicitly want error tokens
  2352.      should shift them.  */
  2353.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  2354.   if (yyn) goto yydefault;
  2355. #endif
  2356.  
  2357. yyerrpop:   /* pop the current state because it cannot handle the error token */
  2358.  
  2359.   if (yyssp == yyss) YYABORT;
  2360.   yyvsp--;
  2361.   yystate = *--yyssp;
  2362. #ifdef YYLSP_NEEDED
  2363.   yylsp--;
  2364. #endif
  2365.  
  2366. #if YYDEBUG != 0
  2367.   if (yydebug)
  2368.     {
  2369.       short *ssp1 = yyss - 1;
  2370.       fprintf (stderr, "Error: state stack now");
  2371.       while (ssp1 != yyssp)
  2372.     fprintf (stderr, " %d", *++ssp1);
  2373.       fprintf (stderr, "\n");
  2374.     }
  2375. #endif
  2376.  
  2377. yyerrhandle:
  2378.  
  2379.   yyn = yypact[yystate];
  2380.   if (yyn == YYFLAG)
  2381.     goto yyerrdefault;
  2382.  
  2383.   yyn += YYTERROR;
  2384.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  2385.     goto yyerrdefault;
  2386.  
  2387.   yyn = yytable[yyn];
  2388.   if (yyn < 0)
  2389.     {
  2390.       if (yyn == YYFLAG)
  2391.     goto yyerrpop;
  2392.       yyn = -yyn;
  2393.       goto yyreduce;
  2394.     }
  2395.   else if (yyn == 0)
  2396.     goto yyerrpop;
  2397.  
  2398.   if (yyn == YYFINAL)
  2399.     YYACCEPT;
  2400.  
  2401. #if YYDEBUG != 0
  2402.   if (yydebug)
  2403.     fprintf(stderr, "Shifting error token, ");
  2404. #endif
  2405.  
  2406.   *++yyvsp = yylval;
  2407. #ifdef YYLSP_NEEDED
  2408.   *++yylsp = yylloc;
  2409. #endif
  2410.  
  2411.   yystate = yyn;
  2412.   goto yynewstate;
  2413. }
  2414. #line 1119 "y.web2c"
  2415.  
  2416.  
  2417. static void compute_array_bounds()
  2418. {
  2419.     long lb;
  2420.     char tmp[200];
  2421.  
  2422.     if (lower_sym == -1) {    /* lower is a constant */
  2423.     lb = lower_bound - 1;
  2424.     if (lb==0) lb = -1;    /* Treat lower_bound==1 as if lower_bound==0 */
  2425.     if (upper_sym == -1)    /* both constants */
  2426.         (void) sprintf(tmp, "[%ld]", upper_bound - lb);
  2427.     else {            /* upper a symbol, lower constant */
  2428.         if (lb < 0)
  2429.         (void) sprintf(tmp, "[%s + %ld]",
  2430.                 symbol(upper_sym), (-lb));
  2431.         else
  2432.         (void) sprintf(tmp, "[%s - %ld]",
  2433.                 symbol(upper_sym), lb);
  2434.     }
  2435.     if (lower_bound < 0 || lower_bound > 1) {
  2436.         if (*array_bounds) {
  2437.         fprintf(stderr, "Cannot handle offset in second dimension\n");
  2438.         exit(1);
  2439.         }
  2440.         if (lower_bound < 0) {
  2441.         (void) sprintf(array_offset, "+%ld", -lower_bound);
  2442.         } else {
  2443.         (void) sprintf(array_offset, "-%ld", lower_bound);
  2444.         }
  2445.     }
  2446.     (void) strcat(array_bounds, tmp);
  2447.     }
  2448.     else {            /* lower is a symbol */
  2449.     if (upper_sym != -1)    /* both are symbols */
  2450.         (void) sprintf(tmp, "[%s - %s + 1]", symbol(upper_sym),
  2451.         symbol(lower_sym));
  2452.     else {            /* upper constant, lower symbol */
  2453.         (void) sprintf(tmp, "[%ld - %s]", upper_bound + 1,
  2454.         symbol(lower_sym));
  2455.     }
  2456.     if (*array_bounds) {
  2457.         fprintf(stderr, "Cannot handle symbolic offset in second dimension\n");
  2458.         exit(1);
  2459.     }
  2460.     (void) sprintf(array_offset, "- (int)(%s)", symbol(lower_sym));
  2461.     (void) strcat(array_bounds, tmp);
  2462.     }
  2463. }
  2464.  
  2465.  
  2466. /* Kludge around negative lower array bounds.  */
  2467.  
  2468. static void
  2469. fixup_var_list ()
  2470. {
  2471.   int i, j;
  2472.   char output_string[100], real_symbol[100];
  2473.  
  2474.   for (i = 0; var_list[i++] == '!'; )
  2475.     {
  2476.       for (j = 0; real_symbol[j++] = var_list[i++]; )
  2477.         ;
  2478.       if (*array_offset)
  2479.         {
  2480.           (void) fprintf (std, "\n#define %s (%s %s)\n  ",
  2481.                           real_symbol, next_temp, array_offset);
  2482.           (void) strcpy (real_symbol, next_temp);
  2483.           /* Add the temp to the symbol table, so that change files can
  2484.              use it later on if necessary.  */
  2485.           j = add_to_table (next_temp);
  2486.           sym_table[j].typ = var_id_tok;
  2487.           find_next_temp ();
  2488.         }
  2489.       (void) sprintf (output_string, "%s%s%c", real_symbol, array_bounds,
  2490.                       var_list[i] == '!' ? ',' : ' ');
  2491.       my_output (output_string);
  2492.   }
  2493.   semicolon ();
  2494. }
  2495.  
  2496.  
  2497. /* If we're not processing TeX, we return false.  Otherwise,
  2498.    return true if the label is "10" and we're not in one of four TeX
  2499.    routines where the line labeled "10" isn't the end of the routine.
  2500.    Otherwise, return 0.  */
  2501.    
  2502. static boolean
  2503. doreturn (label)
  2504.     char *label;
  2505. {
  2506.     return
  2507.       tex
  2508.       && STREQ (label, "10")
  2509.       && !STREQ (my_routine, "macrocall")
  2510.       && !STREQ (my_routine, "hpack")
  2511.       && !STREQ (my_routine, "vpackage")
  2512.       && !STREQ (my_routine, "trybreak");
  2513. }
  2514.  
  2515.  
  2516. /* Return the absolute value of a long.  */
  2517. static long 
  2518. my_labs (x)
  2519.   long x;
  2520. {
  2521.     if (x < 0L) return(-x);
  2522.     return(x);
  2523. }
  2524.  
  2525. static void
  2526. do_proc_args ()
  2527. {
  2528.   fprintf (coerce, "%s %s();\n", fn_return_type, z_id);
  2529. }
  2530.  
  2531. static void
  2532. gen_function_head()
  2533. {
  2534.     int i;
  2535.  
  2536.     if (strcmp(my_routine, z_id)) {
  2537.     fprintf(coerce, "#define %s(", my_routine);
  2538.     for (i=0; i<ids_paramed; i++) {
  2539.         if (i > 0)
  2540.         fprintf(coerce, ", %s", symbol(param_id_list[i]));
  2541.         else
  2542.         fprintf(coerce, "%s", symbol(param_id_list[i]));
  2543.     }
  2544.     fprintf(coerce, ") %s(", z_id);
  2545.     for (i=0; i<ids_paramed; i++) {
  2546.         if (i > 0)
  2547.         fputs(", ", coerce);
  2548.         fprintf(coerce, "(%s) ", arg_type[i]);
  2549.         fprintf(coerce, "%s(%s)",
  2550.             sym_table[param_id_list[i]].var_formal?"&":"",
  2551.             symbol(param_id_list[i]));
  2552.     }
  2553.     fprintf(coerce, ")\n");
  2554.     }
  2555.     std = orig_std;
  2556.     my_output(z_id);
  2557.     my_output("(");
  2558.     for (i=0; i<ids_paramed; i++) {
  2559.         if (i > 0) my_output(",");
  2560.         my_output(symbol(param_id_list[i]));
  2561.     }
  2562.     my_output(")");
  2563.     indent_line();
  2564.     for (i=0; i<ids_paramed; i++) {
  2565.         my_output(arg_type[i]);
  2566.         my_output(symbol(param_id_list[i]));
  2567.         semicolon();
  2568.     }
  2569. }
  2570.